KAP Jasa - kite team Slovenia

A ... *dynamic* ... kite flying session - and a melancholic kite aerial photography session - above the Ljubljana Marshes landscape park, Slovenia.

kapjasa.si/en/seven-rokakkus-i

#kiteaerialphotography #KAP #kite #kites #kiteflying #LjubljanaMArshes #LjubljanskoBarje #nature #landscape #park #river #Ižica #Slovenia

Jul 28, 2025, 09:03 · · · 0 · 0
Stefan Balázs

Sonntags in die @stadtbuechereien_duesseldorf am #KAP gegenüber des #Hauptbahnhof|s - I like ❤️

Klimatisiert, ruhig, keine Hektik und Lesespaß in Griffweite 😍

#Sonntagsdinge #immerwiedersonntags #bibliothek #bib #buecherei #lesen #buecher #books 📚

Elias Mårtenson

Kap marketing post

So, I saw Leetcode question 73, whose description is as follows:

Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's.

In most popular programming languages, something like this is somewhat annoying, forcing you to write some loops that kind of hides what you really want to do.

Even in Excel, I think this will be frustrating, but I'm not an Excel expert.

But if you think about it, if you create a new matrix that contains a bitmask where every cell is 1 where the original matrix contains a nonzeoro value, you can simply check if each row contains all ones, and then do the same check on each column.

Finally, we'll just multiply the new mask with the original matrix, which gives us the result we need:

{
mask ← 0≠⍵
rows ← ∧/mask
cols ← ∧⌿mask
sel ← rows ∧⌻ cols
sel × ⍵
}

Of course, the above is written out with temporary variables. In practice, I'd write it as a single expression like so:

{ ⍵ × (∧/)«∧⌻»(∧⌿) 0≠⍵ }

And of course, people will complain that it's unreadable and whatnot, but these two versions are equivalent, and the latter just takes advantage of the « and » symbols to combine functions.

If anyone has a problem they would otherwise use Excel or some python program to solve, share it with me to see if I can use it to show that Kap can be a better solution. 🙂

(and if I can't, that's even better, because then I have a reason to improve the software)

#kap #apl #programming

Karsten Johansson

Here is some Common Lisp that definitely does not compete with Kap. It only runs in sbcl.

Try it. Marvel at its accuracy. Enjoy!

#kap #lisp #commonlisp #sbcl

;; FACTORIAL-CALCULATOR.LISP
;; A straightforward OOP-based factorial calculator in Common Lisp.
;; Prompts for input, computes factorial, then exits cleanly.

(defpackage :factorial-calculator
(:use :cl)
(:export :main))

(in-package :factorial-calculator)

;;; Basic factorial function (simple recursion)
(defun factorial (n)
"Compute the factorial of N recursively."
(if (<= n 1)
1
(* n (factorial (1- n)))))

;;; Calculator class
(defclass factorial-calculator ()
((number :initarg :number :accessor calc-number
:documentation "The number to compute factorial of.")
(value :initform nil :accessor calc-value
:documentation "The computed factorial result.")))

(defmethod initialize ((calc factorial-calculator) n)
"Initialize calculator state."
(setf (calc-value calc) nil)
(format t ">>> Initialized calculator for ~A.~%" n))

(defmethod compute ((calc factorial-calculator))
"Compute and store the factorial in the calculator."
(let ((result (factorial (calc-number calc))))
(setf (calc-value calc) result)
(format t ">>> Computed factorial: ~A~%" result)))

;;; Main entry point
(defun main ()
"Prompt for input, compute factorial, and exit cleanly."
(format t "Please enter a non-negative integer: ")
(finish-output)
(let* ((input (read-line))
(n (parse-integer input :junk-allowed t)))
(if (or (null n) (< n 0))
(progn
(format t "Invalid input. Exiting.~%")
(sb-ext:quit :unix-status 1))
(let ((calc (make-instance 'factorial-calculator :number n)))
(initialize calc n)
(compute calc)
;; Display result
(format t "Result: ~A! = ~A~%" n (calc-value calc))
(format t ">>> Program complete. Exiting.~%")
(sb-ext:quit :unix-status 0)))))

;; To run:
;; sbcl --script factorial-calculator.lisp
;; or in REPL:
;; (load "factorial-calculator.lisp")
;; (in-package :factorial-calculator")
;; (main)

Europe Says

europesays.com/2240951/ After firing at Kap’s Cafe in Canada, Kapil Sharma breaks silence with his social media post #Canadá #Kap

Elias Mårtenson

@ksaj @praetor @screwlisp Kap is certainly very high level compared to something like C. It doesn't even expose much in the way of system level access. It's more like Python in that respect, except being faster. 🙂

To briefly explain how to read the tacit expressions, all you really have to understand is how functions combine when there is no argument given to it.

Let's take the function - as an example. Just like in standard maths, it has two roles: subtraction (when called with two arguments x-y) or negation (when called with one argument -x).

All right, so let's take a look at the simplest possible function definition using a tacit expression:

foo ⇐ -

After this, you can type 5 foo 2 to get the result 3. Or foo 11 to get -11.

Let's try a so-called 'train'. A train is just a sequence of functions:

foo ⇐ -×

Let's call it with two arguments to see what happens:

10 foo 4
-40

So, we can see how this actually evaluates as -(10×40). This is a general rule when a train is evaluated with two arguments: the right function is called with the two arguments, and then the result is passed to the left function.

Let's call it with one argument:

foo 4
-1

This is the same as -×4. I.e. call ×4 and then pass the result to -. The function × is extended to support called with one argument, and when it does, it returns the absolute value, i.e. 1. This value is negated by calling -.

Now, the rest is just an extension of this. There are several special operators, including , and the pair « and » which can be used to combine functions in more fancy ways than just using trains as explained above. All of this is documented in the reference: kapdemo.dhsdevelopments.com/re

I hope this gives a bit of insight into how these functions can be created.

#kap #apl

Kap reference

kapdemo.dhsdevelopments.com
Elias Mårtenson

I was reading this article by @johndcook which makes a good argument that the up- and down-arrow notation is better for logs and exponents.

In APL (and Kap) the symbols are and which does have symmetry, but perhaps the arrows would be even better.

johndcook.com/blog/2025/05/13/

#apl #kap

Alternative exp and log notation

Alternative notation for exponents and logs using up…

John D. Cook | Applied Mathematics Consulting
Elias Mårtenson

Here's one of those interesting posts by @gregeganSF which talks about some interesting properties of hexadecimal numbers: mathstodon.xyz/@gregeganSF/114

I wanted to play around with this myself, and since I used Kap to do it, I just wanted to share what this looks like. Here's the original list of numbers, computed from first principles by splitting up each number into a binary array, performing the shifts, grouping the bits in groups of 4, encoding each group in binary and then encoding each group in base 16: example

It could have been shorter if I had encoded the entire number in binary first, but I didn't do that because what I actually wanted to do was to work with the groups of 4 bits to show the symmetry where each group adds up to 8. Here's the code to do this: example

The output is as follows:

+/[1] ⊃ (64⍴1 0 0 0) ⊆ ⊃ (⍳5) ⌽¨ ⊂ (64⍴2) ⊤ 0xaf9d03c6be215748
┌→──────┐
↓8 8 8 8│
│8 8 8 8│
│8 8 8 8│
│8 8 8 8│
│8 8 8 8│
└───────┘

If you change the value to a number which doesn't have the symmetry mentioned in the post, the array will not be all the same number.

#maths #kap #apl

Greg Egan (@gregeganSF@mathstodon.xyz)

Here are some 64-bit hexadecimal numbers. af9d03c6be215748 5f3a078d7c42ae91 be740f1af8855d22 7ce81e35f10aba45 f9d03c6be215748a The…

Mathstodon
Elias Mårtenson

Here's one of those interesting posts by @gregeganSF which talks about some interesting properties of hexadecimal numbers: mathstodon.xyz/@gregeganSF/114

I wanted to play around with this myself, and since I used Kap to do it, I just wanted to share what this looks like. Here's the original list of numbers, computed from first principles by splitting up each number into a binary array, performing the shifts, grouping the bits in groups of 4, encoding each group in binary and then encoding each group in base 16: example

It could have been shorter if I had encoded the entire number in binary first, but I didn't do that because what I actually wanted to do was to work with the groups of 4 bits to show the symmetry where each group adds up to 8. Here's the code to do this: example

The output is as follows:

+/[1] ⊃ (64⍴1 0 0 0) ⊆ ⊃ (⍳5) ⌽¨ ⊂ (64⍴2) ⊤ 0xaf9d03c6be215748
┌→──────┐
↓8 8 8 8│
│8 8 8 8│
│8 8 8 8│
│8 8 8 8│
│8 8 8 8│
└───────┘

If you change the value to a number which doesn't have the symmetry mentioned in the post, the array will not be all the same number.

#maths #kap #apl

Greg Egan (@gregeganSF@mathstodon.xyz)

Here are some 64-bit hexadecimal numbers. af9d03c6be215748 5f3a078d7c42ae91 be740f1af8855d22 7ce81e35f10aba45 f9d03c6be215748a The…

Mathstodon
KAP Jasa - kite team Slovenia

Lake Palčje, Slovenia. The star of Pivka seasonal lakes nature park. Ephemeral and timeless.

And hard to get with a camera on a kite.

This is a story that concludes a seven year quest for a successful KAP session here. It was worth the wait.

Enjoy!

kapjasa.si/en/gotcha/

#kiteaerialphotography #KAP #kite #flying #aerial #Palčje #LakePalčje #lake #intermittentlake #karst #Pivka #notranjska #Slovenia

Gotcha! - KAP Jasa - kite team Slovenia

On June 18, 2017 we flew our kite with a camera for…

KAP Jasa - kite team Slovenia
Mar 31, 2025, 10:06 · · · 0 · 0
KAP Jasa - kite team Slovenia

The fortified church of the Holy Trinity in Hrastovlje, Slovenia.

The walls and the towers are guarding a veritable treasure, the frescoes of Janez of Kastav, including the famous Danse Macabre. And the stony defenders are still quite nervous when something wants to peek inside - even if it is just a kite. 

kapjasa.si/en/a-fight-above-th

#kiteaerialphotography #KAP #kite #flying #church #frescoes #DanseMacabre #tabor #wall #tower #fortification #village #Karst #Hrastovlje #Istria #Istra #Slovenia

A Fight Above the Ancient Walls - KAP Jasa - kite team Slovenia

A hill – a defensive position par excellence. A fierce…

KAP Jasa - kite team Slovenia
Mar 04, 2025, 07:45 · · · 1 · 0
KAP Jasa - kite team Slovenia

Sometimes a kite aerial photo seems dull ... Wrong camera settings? Lack of post-processing skills? Is it the old adage - dull weather, dull photos?

Perhaps.

But, at least to us, the real question is - is there really such a thing as a "dull" kite aerial photo? 😉

kapjasa.si/en/when-the-skies-a

#kiteaerialphotography #KAP #kite #kites #flying #aerial #marshes #nature #landscape #grey #weather #LjubljanaMarshes #LjubljanskoBarje #Barje #Insta #rokkaku #Slovenia

When the skies are grey ... - KAP Jasa - kite team Slovenia

This is written, at list partially, in response to…

KAP Jasa - kite team Slovenia
Feb 26, 2025, 08:14 · · · 0 · 0
Elias Mårtenson

I was reading the linked thread, and since I didn't want to take away from the discussion about using Binet's formula, I paste my straightforward iterative solution for Fibonacci numbers in Kap (the example below prints the first 100 numbers, if you want to start a different pair of numbers, change the final 1 to the pair you need):

The computation will automatically use bigint when needed, so there is no real upper limit to the numbers)

↑¨ (+/«⍮»↑ ⊣)\ 100⍴1

mastodon.social/@code_report/1

#kap #programming

Feb 18, 2025, 04:46 · · · 0 · 0