Make an Async task (Java) and...

DONT use a loop to iterate though a time series collection. Don't linear search that shit.

DO use a queue and pop() it like its hot. Check that shit to see when it needs to be used instead of searching.

DO assert that your time series data is in order (Predication mother fucker).

DO throw an exception that you data is all fucked when it's all fuck up.

Stay sexy and use a fucking queue man.

  • 0
    Make sure that your time series data is in the right format that toy expect before being sorted.

    Make sure that what the data that is asked for makes sense with what was asked for should I be given all of the data for last month if I just forget to give the date range? Is that what I'd expect?
  • 0
    Can you explain what is a time series data? From looking it up i only understood its a record with a timestamp.
  • 0
    None of this really makes any sense. Why use a queue and why not loop?

    Loops are perfectly good and even if using a queue you'd usually loop it.

    Queues are common in async though to both preserve order and to allow buffering. They're used very heavily in async and IO in particular.

    Order doesn't always matter but when it does people tend to be blind to it.

    Errors for any unexpected data set is also sadly a rarity. Most error handling I see is stuff like rewrapping errors wasting time and LOC to change the message and very commonly doing things like logging the message at the bottom rather than the top.

    asserts are really handy but you want two versions, one that's skipped from production and one that's not. The ones that are stripped should only be done so when you're 100% certain they can never fail in production.
  • 0
    @yellow-dog AFAIK it can just be an array of timestamps usually denoting frequency. It's a log of events usually of the same type by their dates. Just the same as a log really or anything like that. In science and system monitoring it tends to be things like measure taken every five minutes or something like that like every minute the record of your CPU usage. It's also assumed you'd want to work on it in time order.
  • 0
    I feel like a teenager wrote this.
Add Comment