Fork me on GitHub
#clojure
<
2023-07-26
>
Jake Jasey00:07:48

I am looking to start a clojure project that tracks bills and also balances of bills, however I am trying to figure out if there is a way to connect to all my different bill online portals to fetch the balance, and doing this with authentication. Does anyone have any ideas?

hadils00:07:52

Commercially available: plaid

Jake Jasey03:07:37

Does anyone have a reference for this?

didibus03:07:07

Not really. Most banks don't have APIs or non password based auth. Even plaid needs your login/password which they will store to access the bank

Dr Leonard Anderson06:07:40

Have you looked at decentralised ledger technology, That maintains global immutable records with cryptographic security.

Ben Sless06:07:52

Some banks use Open Banking APIs but onboarding is a pain

practicalli-johnny06:07:39

The UK has an open banking policy that covers 9 of the major banks. It may provide some insights on the kinds of APIs involved. I don't know of any other initiatives like this though https://www.openbanking.org.uk/

vaibhav chaturvedi11:07:41

I saw this today, just saying.. rlwrap(23417,0x1e60a5e00) malloc: Incorrect checksum for freed object 0x15200b800: probably modified after being freed. Corrupt value: 0xc6c60000c600 rlwrap(23417,0x1e60a5e00) malloc: *** set a breakpoint in malloc_error_break to debug rlwrap: Oops, crashed (caught SIGABRT) - this should not have happened! If you need a core dump, re-configure with --enable-debug and rebuild Resetting terminal and cleaning up...

p-himik11:07:18

Doesn't seem related to Clojure at all. The clj script uses rlwrap available in your systme, so what that rlwrap is and what it does is your responsibility.

thheller11:07:42

could be bad RAM. I got weird errors like that last time I had some, used memtest to verify and indeed it was bad.

fabrao14:07:26

hello all, what is the best channel to ask something about https://github.com/bobschrag/clolog ?

seancorfield14:07:54

You might as well ask here, in this thread -- @U65G9MPCK is in this channel (but it's a bit early for him to be online yet).

fabrao14:07:12

ok, thank you for the information, I saw you forked it. Do you like Prolog too?

fabrao14:07:16

I want to know how to define a brother using mom as they have the same mom ? I saw it using sibiling , but is there any way to define like in prolog predicate?

bschrag15:07:29

Hi, @U0YJJPFRA. This seems consistent with the formulation in core_test.clj. Lots of ways to do it, of course. 🙂

;;; To include half brothers:

(<- (brother ?brother ?sibling)
    (parent ?parent ?brother)
    (parent ?parent ?sibling)
    (male ?brother))

;;; For only full brothers:

(<- (mother ?mother ?child)
    (parent ?mother ?child)
    (female ?mother))

(<- (father ?father ?child)
    (parent ?father ?child)
    (male ?father))

(<- (brother ?brother ?sibling)
    (mother ?mother ?brother)
    (father ?father ?brother)
    (mother ?mother ?sibling)
    (father ?father ?sibling)
    (male ?brother))

fabrao16:07:48

great, thank you

👍 2
agorgl15:07:02

Is there a clojure core function in order to split a sequence / string when a predicate between two elements / characters returns true? (I want to split a "camelCased" string to ["camel" "Cased"])

Samuel Ludwig15:07:53

for sequences, you might be looking for a partition function, (with the limit set to 2) There should definitely be a clojure.string/split function, which iirc is looking for some regex

lukasz15:07:05

there's also split-with

jjttjj15:07:44

I often do something like:

(->> (repeatedly 100 #(rand-int 2))
     (partition-all 2 1)
     (map (fn [[x y]] [x (and y (even? x) (even? y))])))
but a regex might be more appropriate for your use

agorgl15:07:14

split-with only works for splitting in first occurrence

agorgl15:07:27

partition in pairs seems like a good idea

p-himik15:07:54

RegEx magic:

(str/split "someCamelCaseString" #"(?![a-z])(?=[A-Z])")
=> ["some" "Camel" "Case" "String"]

🙌 8
p-himik15:07:27

?! - negative lookahead, ?= - positive.

tomd15:07:41

Yeah agree that the regex solution works fine here. More broadly, libs like medley and flatland have functions that deal with these things. E.g. partition-after partition-before and partition-between https://weavejester.github.io/medley/medley.core.html#var-partition-after

tomd15:07:11

I wrote a blog on why two of these are useful here fwiw: https://www.juxt.pro/blog/new-medley-partition-fns/

phill15:07:15

Could refer to the source of https://github.com/clj-commons/camel-snake-kebab for techniques

🔥 4
Alvydas Vitkauskas16:07:55

You may also want to use negative lookbehind if you do not want your string to be split on each consecutive Capital letter:

(str/split "someUUUpperCaseString" #"(?<![A-Z])(?=[A-Z])")
=> ["some" "UUUpper" "Case" "String"]

👍 2
☝️ 2