Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

factors

Why is the terminology of labels and levels in factors so weird?

August 24, 2023 by Tarik
Categories r Tags factors, levels, r Leave a comment

Segmented Sieve of Eratosthenes?

July 31, 2023 by Tarik

The basic idea of a segmented sieve is to choose the sieving primes less than the square root of n, choose a reasonably large segment size that nevertheless fits in memory, and then sieve each of the segments in turn, starting with the smallest. At the first segment, the smallest multiple of each sieving prime … Read more

Categories algorithm Tags algorithm, factors, prime-factoring, primes, sieve-of-eratosthenes Leave a comment

Why is my Swift loop failing with error “Can’t form range with end < start"?

July 29, 2023 by Tarik

Swift 5 If you need a loop with dynamic value-range, I suggest that using stride(to:by:) instead of ..< or … Basically ..< or … will be crashed if start_index > end_index. This will be crash: let k = 5 for i in 10…k { print(“i=\(i)”) } for i in 10..<k { print(“i=\(i)”) } How to … Read more

Categories swift Tags factors, for-loop, runtime-error, swift Leave a comment

nᵗʰ ugly number

June 2, 2023 by Tarik

A simple fast solution in Java. Uses approach described by Anon.. Here TreeSet is just a container capable of returning smallest element in it. (No duplicates stored.) int n = 20; SortedSet<Long> next = new TreeSet<Long>(); next.add((long) 1); long cur = 0; for (int i = 0; i < n; ++i) { cur = next.first(); … Read more

Categories algorithm Tags algorithm, factors, hamming-numbers, math, primes Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa