• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Tuesday, July 1, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

    Artificial Intelligence

    Normalizing Flows are Capable Generative Models

    Artificial Intelligence

    Update on the AWS DeepRacer Student Portal

  • App Zone
    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

  • Apple

    July 1, 2025 – Apple AI rumors, 10 years of Apple Music

    Will the iPhone 17 lineup really have higher refresh rate displays?

    The biggest iPhone 17 mystery left could swing a lot of upgrade decisions

    Apple hit with $110M damages in 3G patents lawsuit

    Apple hit with $110M damages in 3G patents lawsuit

    Photos iOS 26 vs iOS 18: Compared

    Photos iOS 26 vs iOS 18: Compared

    Here’s everything new for Apple Photos in iOS 26

    Here’s everything new for Apple Photos in iOS 26

    Apple gains ground with new Macs despite market challenges

    Apple gains ground with new Macs despite market challenges

    Anker Power Bank, Zolo, MagGo, recall

    Anker Power Bank, Zolo, MagGo, recall

    Developer for Linux on Apple Silicon Macs resigns, citing ‘major failure of leadership’

    New ‘MacBook’ rumor sounds like Apple’s taking the iPad approach

    Apple Music 10 year celebration

    Apple Music 10 year celebration

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    Sonic & SEGA All-Stars Racing – Xbox 360

    Sonic & SEGA All-Stars Racing – Xbox 360

    Carnival Games – Nintendo Wii (Renewed)

    Carnival Games – Nintendo Wii (Renewed)

    Transformers Devastation – PlayStation 3

    Transformers Devastation – PlayStation 3

  • Tech Eats
    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

  • Tesla
    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

  • UFO
    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Alien 3's Workprint: What Else Was Cut From the Film?

    Alien 3's Workprint: What Else Was Cut From the Film?

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

    Artificial Intelligence

    Normalizing Flows are Capable Generative Models

    Artificial Intelligence

    Update on the AWS DeepRacer Student Portal

  • App Zone
    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

  • Apple

    July 1, 2025 – Apple AI rumors, 10 years of Apple Music

    Will the iPhone 17 lineup really have higher refresh rate displays?

    The biggest iPhone 17 mystery left could swing a lot of upgrade decisions

    Apple hit with $110M damages in 3G patents lawsuit

    Apple hit with $110M damages in 3G patents lawsuit

    Photos iOS 26 vs iOS 18: Compared

    Photos iOS 26 vs iOS 18: Compared

    Here’s everything new for Apple Photos in iOS 26

    Here’s everything new for Apple Photos in iOS 26

    Apple gains ground with new Macs despite market challenges

    Apple gains ground with new Macs despite market challenges

    Anker Power Bank, Zolo, MagGo, recall

    Anker Power Bank, Zolo, MagGo, recall

    Developer for Linux on Apple Silicon Macs resigns, citing ‘major failure of leadership’

    New ‘MacBook’ rumor sounds like Apple’s taking the iPad approach

    Apple Music 10 year celebration

    Apple Music 10 year celebration

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    Sonic & SEGA All-Stars Racing – Xbox 360

    Sonic & SEGA All-Stars Racing – Xbox 360

    Carnival Games – Nintendo Wii (Renewed)

    Carnival Games – Nintendo Wii (Renewed)

    Transformers Devastation – PlayStation 3

    Transformers Devastation – PlayStation 3

  • Tech Eats
    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

  • Tesla
    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

  • UFO
    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Alien 3's Workprint: What Else Was Cut From the Film?

    Alien 3's Workprint: What Else Was Cut From the Film?

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

evolvedbinary/j8cu: Java 8 Collection Utilities

Hacker News by Hacker News
February 5, 2025
in Hacker News
Reading Time: 12 mins read
123
A A
0

2025-02-05 13:40:00
github.com

CircleCI
Coverage Status
Java 8
License
Maven Central

Some extra Collection classes targetting Java 8.

The main thing here at the moment is a RingBuffer implementation.

You can add the library to your project as a dependency with the following Maven coordinates:

dependency>
    groupId>com.evolvedbinary.j8cugroupId>
    artifactId>j8cuartifactId>
    version>1.0.0version>
dependency>

Implementation of a RingBuffer (e.g. https://en.wikipedia.org/wiki/Circular_buffer) in Java 8.
This implementation supports two modes of operations for reading from the buffer:

1. Unordered (the default)
2. Ordered

The difference between Unordered and Ordered modes is that when you use Unordered mode,
it starts reading from the start of the buffer, whilst Ordered mode starts reading from the
oldest entry in the buffer. Ordered mode has FIFO (First In, First Out) like semantics.

Ordered mode is useful for when you want to keep a buffer of the most recent N objects,
and you need to read them back from oldest to newest.

The RingBuffer also provides several additional features:

  • Listeners may be registered to receive events when the state of the RingBuffer changes.
  • All entries may be copied out of the RingBuffer.
  • The RingBuffer can be cleared which removes references to all entries and resets its state, or it can just be reset whereby any entry references are maintained but could be overwritten in future on subsequence calls to put.

Unordered Ring Buffer Example

import com.evolvedbinary.j8cu.RingBuffer;
    
final int capacity = 3;
final RingBufferString> ringBuffer = new RingBuffer(String.class, capacity);

ringBuffer.put("a");
ringBuffer.put("b");
ringBuffer.put("c");
ringBuffer.put("d");
ringBuffer.put("e");

Then subsequent calls to get entries from the RingBuffer would produce:

ringBuffer.get() => "d"
ringBuffer.get() => "e"
ringBuffer.get() => "c"
ringBuffer.get() => null

Ordered Ring Buffer Example

import com.evolvedbinary.j8cu.RingBuffer;
    
final int capacity = 3;
final boolean orderedReads = true;
final RingBufferString> ringBuffer = new RingBuffer(String.class, capacity, orderedReads);

ringBuffer.put("a");
ringBuffer.put("b");
ringBuffer.put("c");
ringBuffer.put("d");
ringBuffer.put("e");

Then subsequent calls to get entries from the RingBuffer would produce:

ringBuffer.get() => "c"
ringBuffer.get() => "d"
ringBuffer.get() => "e"
ringBuffer.get() => null

Listening to RingBuffer Events

It is also possible to add and remove listeners to a RingBuffer. One reason this can be useful would be if you would
like to get and/or be notified the next n entries within some sort of window (e.g. time frame or event space). For example:

import com.evolvedbinary.j8cu.RingBuffer;
import org.jspecify.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;


final int capacity = 7;
final boolean orderedReads = true;
final RingBufferString> ringBuffer = new RingBuffer(String.class, capacity, orderedReads);

// capture the entries added to the RingBuffer in the next 2 seconds
final int windowSeconds = 2;
final TimeWindowListener timeWindowListener = new TimeWindowListener(windowSeconds);
ringBuffer.addListener(timeWindowListener);

// put entries for the next 2 * 1.5 seconds
final long end = System.currentTimeMillis() + (windowSeconds * 1_500);
int i = 0;
while (System.currentTimeMillis() end) {
    final int increment = i++ % 24;
    ringBuffer.put("" + (char)('a' + increment));
    Thread.sleep(250); // slow down this is just a demo!
}

// print out what was captured by the listener
final ListString> captured = timeWindowListener.getCaptured();
System.out.println("Added: " + captured.size());
System.out.println("Captured: " + captured);


/**
 * Simple example listener implementation that captures all `put` entries for a window measured in seconds
 */
private static class TimeWindowListener implements RingBuffer.ListenerString> {
    private final int window;  // seconds
    private final long start;
    private final ListString> captured = new ArrayList();

    public TimeWindowListener(final int window) {
        this.window = window;
        this.start = System.currentTimeMillis();
    }

    @Override
    public void retrieved(final @Nullable String entry) {
    }

    @Override
    public void stored(final String entry) {
        final long diff = System.currentTimeMillis() - start;
        if (diff long) window) * 1_000) {
            captured.add(entry);
        }
    }

    public ListString> getCaptured() {
        return new ArrayList(captured);
    }
}

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share162Share28ShareShare4ShareTweet101
Previous Post

The budget ASUS ROG Phone 9 FE is finally here with a 2023 chip and gaming AI

Next Post

These Are the Best `Price-Tracking Tools

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

Graph Theory Applications in Video Games
Hacker News

Graph Theory Applications in Video Games

July 1, 2025
1.3k
Snake Keyloggers Exploit Java Utilities to Evade Detection by Security Tools
Hacker News

Snake Keyloggers Exploit Java Utilities to Evade Detection by Security Tools

July 1, 2025
1.3k
topling/toplingdb: ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction
Hacker News

topling/toplingdb: ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction

July 1, 2025
1.3k
RP2350pc Open Source Hardware all in one computer with RP2350B, 8MB PSRAM, 16MB Flash, Four USB host, DVI/HDMI output and Audio Codec for retro computer emulation and education
Hacker News

RP2350pc Open Source Hardware all in one computer with RP2350B, 8MB PSRAM, 16MB Flash, Four USB host, DVI/HDMI output and Audio Codec for retro computer emulation and education

July 1, 2025
1.3k
New C4 Bomb Attack Breaks Through Chrome’s AppBound Cookie Protections
Hacker News

New C4 Bomb Attack Breaks Through Chrome’s AppBound Cookie Protections

July 1, 2025
1.3k
stan-smith/OpenFLOW: Make beautiful isometric infrastructure diagrams
Hacker News

stan-smith/OpenFLOW: Make beautiful isometric infrastructure diagrams

July 1, 2025
1.3k
Public Signal Backups Testing – Call for Testing
Hacker News

Public Signal Backups Testing – Call for Testing

June 30, 2025
1.3k
The New Skill in AI is Not Prompting, It’s Context Engineering
Hacker News

The New Skill in AI is Not Prompting, It’s Context Engineering

June 30, 2025
1.3k
Load More
Next Post
These Are the Best `Price-Tracking Tools

These Are the Best `Price-Tracking Tools

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Forbes
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Gaming
  • I Like Cats ™
  • I Like Dogs ™
  • MacRumors
  • Macworld
  • Tech Deals
  • Techcratic ™
  • Techs Got To Eat ™
  • Tesla
  • UFO
  • Wired