<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Highlights on Zero Entropy</title>
    <link>https://ruslan.ibragimov.by/categories/highlights/</link>
    <description>Recent content in Highlights on Zero Entropy</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 11 Aug 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://ruslan.ibragimov.by/categories/highlights/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Koin Puzzler</title>
      <link>https://ruslan.ibragimov.by/2024/08/11/koin-puzzler/</link>
      <pubDate>Sun, 11 Aug 2024 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2024/08/11/koin-puzzler/</guid>
      <description>I started using Koin starting from version 2.0.1, almost five years ago. Back then, I hadn’t yet seen how it was possible to write even large Kotlin applications that would be easy to test without using something from the set: spring-context, guice, koin, kodein, etc.&#xA;At that time, to get an “isolated” Koin context instead of the default global one, you had to use the following approach:&#xA;suspend fun main() { val agentModule = module { single&amp;lt;AgentApplication&amp;gt;() // .</description>
    </item>
    <item>
      <title>Publish maven artifact to S3</title>
      <link>https://ruslan.ibragimov.by/2021/02/04/publish-maven-artifact-to-s3/</link>
      <pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2021/02/04/publish-maven-artifact-to-s3/</guid>
      <description>Create AWS account https://aws.amazon.com/&#xA;Create AWS S3 Bucket and make it public Bucket policy&#xA;{ &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;, &amp;#34;Statement&amp;#34;: [ { &amp;#34;Sid&amp;#34;: &amp;#34;PublicRead&amp;#34;, &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;, &amp;#34;Principal&amp;#34;: &amp;#34;*&amp;#34;, &amp;#34;Action&amp;#34;: [ &amp;#34;s3:GetObject&amp;#34;, &amp;#34;s3:ListBucket&amp;#34; ], &amp;#34;Resource&amp;#34;: [ &amp;#34;arn:aws:s3:::bucket-name&amp;#34;, &amp;#34;arn:aws:s3:::bucket-name/*&amp;#34; ] } ] } Create AWS Credentials Create IAM Policy Create IAM Group Create IAM User AWS Credentials&#xA;AWS_ACCESS_KEY_ID: AKIAWEMDLXBHKYY2SV45 AWS_SECRET_ACCESS_KEY: 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 Setup maven-publish plugin in Gradle plugins { kotlin(&amp;#34;jvm&amp;#34;).version(&amp;#34;1.4.21&amp;#34;) `maven-publish` } group = &amp;#34;io.heapy.deploy-sample&amp;#34; version = &amp;#34;1.</description>
    </item>
    <item>
      <title>SLF4J Fluent Logging API in Kotlin</title>
      <link>https://ruslan.ibragimov.by/2019/08/26/slf4j-fluent-api-kotlin/</link>
      <pubDate>Mon, 26 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2019/08/26/slf4j-fluent-api-kotlin/</guid>
      <description>SLF4J 2.0.0 introduced new logging API:&#xA;logger.atInfo().log(&amp;#34;Hello world&amp;#34;) New fluent api looks more verbose in simple cases like this. Let&amp;rsquo;s compare it to traditional API:&#xA;// traditional logger.info(&amp;#34;Hello world&amp;#34;) // fluent logger.atInfo().log(&amp;#34;Hello world&amp;#34;) You may think that more advanced use-cases will be more readable or shorter. Let&amp;rsquo;s check:&#xA;logger.debug(&amp;#34;Temperature set to {}. Old temperature was {}.&amp;#34;, newT, oldT) logger.atDebug().addArgument(newT).addArgument(oldT).log(&amp;#34;Temperature set to {}. Old temperature was {}.&amp;#34;) logger.atDebug().log(&amp;#34;Temperature set to {}. Old temperature was {}.</description>
    </item>
    <item>
      <title>Benefits of Kotlin</title>
      <link>https://ruslan.ibragimov.by/2019/08/25/benefits-of-kotlin/</link>
      <pubDate>Sun, 25 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2019/08/25/benefits-of-kotlin/</guid>
      <description>This post was triggered by following tweet:&#xA;Again and again I see as people compare languages/frameworks/approaches using only qualities which makes X looking better than Y, completely ignoring benefits that Y gives.&#xA;There are was some java code in OkHttp library, and it&amp;rsquo;s backward-compatible replacement written in Kotlin. Cool thing is, that even when Kotlin code backward compatible, it do much more than Java and already more readable and concise!</description>
    </item>
    <item>
      <title>How to write typed Middleware in Redux</title>
      <link>https://ruslan.ibragimov.by/2019/03/29/how-to-write-typed-middleware-in-redux/</link>
      <pubDate>Fri, 29 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2019/03/29/how-to-write-typed-middleware-in-redux/</guid>
      <description>Just a small snippet which uses TypeScript to define types in middleware declaration. So implementation of middleware becomes possible even without documentation: you just use types to understand what functions do!&#xA;import {Action, Dispatch, Middleware, Store} from &amp;#34;redux&amp;#34;; import {AppState} from &amp;#34;./store/AppState&amp;#34;; export function createMiddleware(): Middleware { return function (store: Store&amp;lt;AppState&amp;gt;) { return function (next: Dispatch) { return function (action: Action): Action { return next(action) } } } } Where AppState is simple interface which represents object stored in redux store.</description>
    </item>
    <item>
      <title>Gradle 5.0: Java heap space</title>
      <link>https://ruslan.ibragimov.by/2018/11/15/gradle-5.0-java-heap-space/</link>
      <pubDate>Thu, 15 Nov 2018 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2018/11/15/gradle-5.0-java-heap-space/</guid>
      <description>Today I try to update my work project to latest and greatest gradle 5.0-rc-2, and all works fine on my machine, but on CI I get the following error:&#xA;$ export GRADLE_USER_HOME=&amp;#34;$(pwd)/.gradle&amp;#34; $ ./gradlew check installDist Downloading https://services.gradle.org/distributions/gradle-5.0-rc-2-all.zip ........................................................................................................................... Welcome to Gradle 5.0-rc-2! Here are the highlights of this release: - Kotlin DSL 1.0 - Task timeouts - Dependency alignment aka BOM support - Interactive `gradle init` For more details see https://docs.</description>
    </item>
    <item>
      <title>How to use Kotlin Dev repository with Gradle Kotlin DSL</title>
      <link>https://ruslan.ibragimov.by/2018/11/14/how-to-use-kotlin-dev-repository-with-gradle-kotlin-dsl/</link>
      <pubDate>Wed, 14 Nov 2018 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2018/11/14/how-to-use-kotlin-dev-repository-with-gradle-kotlin-dsl/</guid>
      <description>If you try to use some dev version of kotlin, for example:&#xA;// file: build.gradle.kts plugins { kotlin(&amp;#34;jvm&amp;#34;).version(&amp;#34;1.3.20-dev-1612&amp;#34;) } You will get the following exception:&#xA;* What went wrong: Plugin [id: &amp;#39;org.jetbrains.kotlin.jvm&amp;#39;, version: &amp;#39;1.3.20-dev-1612&amp;#39;] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in &amp;#39;org.gradle&amp;#39; namespace) - Plugin Repositories (could not resolve plugin artifact &amp;#39;org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.3.20-dev-1612&amp;#39;) Searched in the following repositories: BintrayJCenter Gradle Central Plugin Repository In old-fashion buildscript block you can define repositories, but with shiny new plugins block it&amp;rsquo;s impossible.</description>
    </item>
    <item>
      <title>How to use Apache AsyncHttpClient with Kotlin Coroutines</title>
      <link>https://ruslan.ibragimov.by/2017/06/08/how-to-use-apache-asynchttpclient-with-kotlin-coroutines/</link>
      <pubDate>Thu, 08 Jun 2017 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2017/06/08/how-to-use-apache-asynchttpclient-with-kotlin-coroutines/</guid>
      <description>upd. Code updated to work with Kotlin 1.3 and stable coroutines.&#xA;If you try to use Apache Async HttpClient with Kotlin coroutines you will found that their API (execute method) returns java.util.concurrent.Future that can&amp;rsquo;t be simply used with coroutines. But, you also allowed to pass future callback to execute method:&#xA;// interface HttpAsyncClient Future&amp;lt;HttpResponse&amp;gt; execute( HttpUriRequest request, FutureCallback&amp;lt;HttpResponse&amp;gt; callback ); Let&amp;rsquo;s take a look at FutureCallback interface:&#xA;public interface FutureCallback&amp;lt;T&amp;gt; { void completed(T result); void failed(Exception ex); void cancelled(); } Step 1: Init.</description>
    </item>
    <item>
      <title>Small scopes and SRP rocks, isn’t it?</title>
      <link>https://ruslan.ibragimov.by/2017/05/23/small-scopes-and-srp-rocks-isnt-it/</link>
      <pubDate>Tue, 23 May 2017 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2017/05/23/small-scopes-and-srp-rocks-isnt-it/</guid>
      <description>We discussing recent post by &amp;ldquo;OOP&amp;rdquo; funboy Yegor Bugayenko.&#xA;My thoughts that it&amp;rsquo;s not about FP or OOP, objects or functions, it&amp;rsquo;s all about SRP. Like we have two initialization blocks in one method, and then we test results of these blocks. We can move this blocks in lambdas/functions/classes, but in general it&amp;rsquo;s just two functions that produces a and b and then we compare a and b. After working with Kotlin I&amp;rsquo;ll write this test like:</description>
    </item>
    <item>
      <title>Awesome Kotlin</title>
      <link>https://ruslan.ibragimov.by/2016/02/06/awesome-kotlin/</link>
      <pubDate>Sat, 06 Feb 2016 00:00:00 +0000</pubDate>
      <guid>https://ruslan.ibragimov.by/2016/02/06/awesome-kotlin/</guid>
      <description>Yay, Kotlin at the finish line to release, and for help you finding valuable project Awesome Kotlin list exists! Feel free to spread it over the Internet and contribute new links and projects.&#xA;Happy coding with Kotlin!</description>
    </item>
  </channel>
</rss>
