• Breaking News

    Thursday, July 4, 2019

    Is there an algorithm that deals with this problem? (File chunks and offsets) Computer Science

    Is there an algorithm that deals with this problem? (File chunks and offsets) Computer Science


    Is there an algorithm that deals with this problem? (File chunks and offsets)

    Posted: 04 Jul 2019 01:15 AM PDT

    You have a audio file that is split by size into n files.

    There are several "chapters" in the content. A chapter is made of a file that it starts on, and an offset. So to stream chapter X, you would have to go to file Y and seek to offset Z.

    The question is, given a file and an offset, find which chapter is currently being streamed.

    Example:

    [{ name: "chapter one: something, file: "file01.mp3", offset: 0 }, { name: "chapter two: something, file: "file01.mp3", offset: 900 }, { name: "chapter three: something, file: "file02.mp3", offset: 10 }, ...] 

    Input: file = "file02.mp3", offset = 2

    Output:

    { name: "chapter two: something, file: "file01.mp3", offset: 900 }, 

    EDIT: an edge case is a chapter that spans multiple files

    EDIT 2: my solution

    1. If there are no chapters that start on the current file, You would have to check if there are chapters that start on the (i - 1)th file, if not then check (i - 2)th file and so on. The last chapter that starts on the (i - something) file is currently playing.

    2. Otherwise, find the leftest-most chapter that starts on the current file with a higher offset than my current offset (smallest larger)

    3. if present, then the previous chapter is currently streaming. otherwise, the last chapter that starts on that file is currently playing. The last chapter will always exist due to the check we do in step 1.

    submitted by /u/dexterleng
    [link] [comments]

    Researchers have created AI algorithm that can help forecasters recognize potential severe storms more accurately & quickly.

    Posted: 04 Jul 2019 01:57 AM PDT

    Concerns on Social Media Over Google ML Patents

    Posted: 03 Jul 2019 08:36 AM PDT

    Representing fitness landscapes by valued constraints to understand the complexity of local search

    Posted: 03 Jul 2019 05:41 AM PDT

    Old Assembly Programming Hardware

    Posted: 03 Jul 2019 07:39 AM PDT

    Thanks /u/khedoros! It was a Mitsubishi FX PLC, no idea which one though.

    Years ago at my old school I was good friends with our Technology teacher, and he let me use a sort of "programming board" to control a pump and a light.

    Chances are really slim that anyone else has ever even seen one, and I don't recall much of it. Only that it had a red display that could show current memory address and the assembly operation at that address, and that I found it strange because it was a Japanese car brand that had made the module. It looked old, with yellowed plastic, maybe 1970 or 1980.

    That's all I remember about it, I'm not even really sure what it was meant to do if it wasn't a learning tool for programming.

    I've been searching google for days, but I just can't find it because I have nothing but that to go on.

    Sorry if I'm not allowed to post this here, just was really curious as to if anyone else has used one of those or know what they are. If not allowed, can someone point me to somewhere it does belong? :)

    submitted by /u/SecuctiveMew_
    [link] [comments]

    Fractal.parts - View and design beautiful fractals.

    Posted: 03 Jul 2019 10:08 AM PDT

    What does heap and stack store?

    Posted: 03 Jul 2019 02:02 PM PDT

    No comments:

    Post a Comment