• Home
  • Author
  • Privacy Policy & Terms
Swift & Small Pieces
ARTICLES ABOUT SWIFT , OBJECTIVE-C, ALGORITHMS and Cryptography BY THOMAS KAUSCH

Get in Contact

Menu Close
  • Home
  • Author
  • Privacy Policy & Terms

Author: tomkausch

Iterator Pipes in Python

January 6, 2023tomkausch Leave a Comment

In Python, a generator is a function that returns an iterator that produces a sequence of values when iterated over. Generators are useful when we want to produce a large sequence of values – so these values do not need… Continue Reading →

Uncategorized generator, iterator, prim, python

Swift & Arithmetic Overflow

July 10, 2022tomkausch Leave a Comment

When you start implementing your own arithmetic algorithms you will sooner than later encounter overflow errors. Unlike arithmetic operators in C, arithmetic operator in Swift don’t overflow by default. Overflow behaviour is trapped and reported as an error. You have… Continue Reading →

Uncategorized

Closures in Swift

June 30, 2022tomkausch Leave a Comment

Closures are a powerful programming concept that enable many different programming patterns. However, for lots of beginning programmers, closures can be tricky to use and understand. This is especially true when closures are used in an asynchronous context. For example,… Continue Reading →

Uncategorized

guard & defer

June 30, 2022tomkausch Leave a Comment

“We should do (as wise programmers aware of our limitations) our utmost best to … make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible.”  —Edsger W. Dijkstra, “Go… Continue Reading →

Swift defer, guard

Fast Queue implementation for SWIFT

January 26, 2022tomkausch Leave a Comment

The Swift Standard Library currently implements the three most essential general-purpose data structures: Array, Set and Dictionary. These are the right tool for a wide variety of use cases, and they are particularly well-suited for use as currency types. But sometimes, in order to… Continue Reading →

Algorithms, Code Blocks, iOS, Swift, Uncategorized

Why protocols can only be used as generic constraints when they have Self or an associated type requirement.

January 26, 2022tomkausch Leave a Comment

Protocols with associated types are a powerful, if somewhat treacherous, feature of Swift. Sometimes it’s fair to say that the only winning move is not to play it. As an example here is a recursive protocol of binary tree node… Continue Reading →

Uncategorized

Producer-Consumer Problem with GCD and Sempaphors using Swift (Part 1)

January 2, 2022tomkausch Leave a Comment

The producer–consumer problem also known as the bounded-buffer problem is a classic example of a multi-process synchronisation problem. It is defined as follows: The Producer generates items in random time intervals and writes them into a bounded buffer. The Consumer consumes these items… Continue Reading →

Algorithms, Code Blocks, Concurrency, Swift concurrency, swift

Latest Swift running with Docker

December 17, 2021tomkausch Leave a Comment

Swift is a programming language that is designed to work with Apple’s ecosystem. However, it can run on Linux. It is not just written for Apple products. If you do not have Mac hardware or you do not want to… Continue Reading →

Dev Tools, Swift Swift5.5

Explore Frameworks and Packages with Playgrounds

August 29, 2021tomkausch Leave a Comment

Xcode Playgrounds help developers explore Swift language and Apple framework APIs and provide a scratchpad for experimentation. Since Xcode 12 playgrounds have been integrated with the new build system and can also used with Frameworks and Package dependencies. As long… Continue Reading →

Swift, XCode

Solving a simple code puzzle in Swift

June 16, 2021tomkausch Leave a Comment

Georgina loves making up weird sequences. Here is her latest: “1 2 4 8 10 20 22 44 46 92 94 188 190 380…” Write a program that finds the sum of the first 150 numbers in Georgina’s series. There… Continue Reading →

Algorithms, Languages swift

Post navigation

← Older Articles
Newer Articles →

Thomas Kausch

Recent Posts

  • REST Client Code Generation in Kotlin Multiplatform
  • Sunday afternoon Problem: Lazy Sequences as a Dynamic Programming Primitive in Kotlin
  • How Kotlin’s Inline Functions Make Lambdas First-Class Citizens for Functional Programming
  • Koog
  • Kotlin Multiplatform (KMP) and xcframework: Sharing Logic with iOS Without the Pain

Recent Comments

    Categories

    Algorithms Augmented Reality Code Blocks Concurrency Dev Tools Effective Objective-C Encoding & Decoding Date iOS Languages Objective-C Pyhthon Security Swift Uncategorized Virtual Reality XCode
    © 2026 Swift & Small Pieces. All rights reserved.
    Fashionista by aThemes