development

Automatic retry function with Kotlin flows

Automatic retry function with Kotlin flows

Table of contents Short code example Why use this? My app on the Google play store Resources Programming Android with Kotlin: Achieving Structured Concurrency with Coroutines. Chapter 10 Short code example Here is the code that will allow you to make automatic retries on a flow: fun <T, R : Any> Flow<T>.mapWithRetry( action: suspend (T) -> R, predicate: suspend (R, attempt: Int) -> Boolean ) = map { data -> var attempt = 0L var shallRetry: Boolean var lastValue: R? = null do { val tr = action(data) shallRetry = predicate(tr, (++attempt).toInt()) if (!shallRetry) lastValue = tr } while (shallRetry)…
Read More
Ines Montani at QCon London: Economies of Scale Can’t Monopolise the AI Revolution

Ines Montani at QCon London: Economies of Scale Can’t Monopolise the AI Revolution

During her presentation at QCon London, Ines Montani, co-founder and CEO of explosion.ai (the maker of spaCy), stated that economies of scale are not enough to create monopolies in the AI space and that open-source techniques and models will allow everybody to keep up with the "Gen AI revolution". Montani opened her presentation by asking for a show of hands to identify the open-source users in the audience. The vast majority of the audience raised their hand, easily demonstrating that open-source is ubiquitous ("it would be easier to ask who doesn’t use open-source’"). She pointed out the multiple benefits of the…
Read More
YugabyteDB ♥️ Hashicorp Vault – Fun Times

YugabyteDB ♥️ Hashicorp Vault – Fun Times

I have been working with YugabyteDB for a while now. I am always experiment with yugbayte + (something). Today, its Vault. I have also worked on Vault for a bit and did a a lightening talk earlier this year. That talks was primarily around the data masking. But today, I was exploring the database secret engine. For the uninitiated, Vault provides you with ability to dynamically generate database credentials for your application. It does this by leveraging the simple RBAC SQLs provided by the database engine. It supports variety of databases including Postgres, and YugabyteDB by compatibility. What triggered this…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.