Show newer

Which program language would most excite you to want to contribute to an open-source project, all else being equal?

testing one-way QOTO to twitter cross-posting to

FlightGear is a free, open-source, cross-platform flight simulator.

https://www.flightgear.org

Mac download is 1.8 gigs, expanding to 2.72 gigs. Waiting for that expansion as I type this.
Show thread

So after some tweaking and cleaning I think I'm going with this version for my middle name

After a bit more practice and tweaking this is what I agot out of the #4 stylization

Not a perfect signature or example but I'd love to hear everyone's opinion on the new double-L style I'm playing with. Love or hate? Also I'd love to see any suggestions anyone has for alter active double L stylizations.

I really can't get enough of this ink. It looks like an unassuming purple-black ink most of the time but if the light hits it on an angle it suddenly becomes gold. It has no sparkles or flecks in it though.

This was written with my vintage franken-pen. It uses a 114 year old Waterman's Ideal #2 nib in a TWSBI Diamond with a new customized ebonite feed. The ink is Diamine's Phillip ink.

@Absinthe @freemo

My Elm solution. Change the input sequence of numbers from 1 to 9, and the count plus all the possible decodings will be output instantly.

https://ellie-app.com/6Q5BTjx8CGta1

#toyprogrammingchallenge

Octave solution 

@Absinthe

Linear in time and space by taking advantage of the Fibonacci numbers.

function count = interpretations(string)
ambig = string(1:end-1) == '1' | (string(1:end-1) == '2' & string(2:end) <= '6');
ambig &= string(1:end-1) ~= '0' & string(2:end) ~= '0' & [string(3:end) '1'] ~= '0';
ambig = [false ambig false];
consec = find(ambig(1:end-1) & !ambig(2:end)) - find(!ambig(1:end-1) & ambig(2:end));

fibo = zeros(max(consec), 1);
fibo(1:2) = [2 3];
for i = 3:max(consec)
fibo(i) = fibo(i - 1) + fibo(i - 2); end;
count = prod(arrayfun(@(x)fibo(x), consec)); end;

@Absinthe BTW i intentionally chose to list them not count them. I could probably optimize further if I counted only.

Show thread

This was a really fun programming challenge originally proposed by @Absinthe I want to paste it here, along with my solution, so everyone who is interested can check it out.

Here is the link to his original post: qoto.org/@Absinthe/10289580109


Another Freebie...

This problem was asked by Facebook.

Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.

For example, the message '111' would give 3, since it could be decoded as 'aaa', 'ka', and 'ak'.

You can assume that the messages are decodable. For example, '001' is not allowed.

Here is the link to my solution: qoto.org/@freemo/1028986298217

My solution. This should be a somewhat space-optimized solution in ruby based off the modified concept of a Trie.

git.qoto.org/snippets/4

If i made this into a Radix Trie by compressing nodes with single children down I could reduce this further.

But since it does work I thought I'd share it as is. I'll update everyone if i decide to finish optimizing this particular solution.

It does however do a fairly decent job at compressing the tree by making sure no subtree is a duplicate of any other part of the tree (a node of any specific length/id will be the only node with that length.

For clarity I attached a picture from my notes of what the Trie would look like for the encoded string "12345" where the value inside each circle/node is the "length" value of that node, and the value attached to an arrow/vector/edge is the "chunk" associated with that link. The end result is any path from the minimum node (0) to the maximum node (5). This diagram does not include incomplete paths which my program does right now.

Incomplete paths can also be trimmed to further reduce the space. But since incomplete paths each add only a single leaf node to the tree, and might be useful for various use cases I decided to keep it.

@Absinthe My solution. This should be a somewhat space-optimized solution in ruby based off the modified concept of a Trie.

git.qoto.org/snippets/4

If i made this into a Radix Trie by compressing nodes with single children down I could reduce this further.

But since it does work I thought I'd share it as is. I'll update everyone if i decide to finish optimizing this particular solution.

It does however do a fairly decent job at compressing the tree by making sure no subtree is a duplicate of any other part of the tree (a node of any specific length/id will be the only node with that length.

For clarity I attached a picture from my notes of what the Trie would look like for the encoded string "12345" where the value inside each circle/node is the "length" value of that node, and the value attached to an arrow/vector/edge is the "chunk" associated with that link. The end result is any path from the minimum node (0) to the maximum node (5). This diagram does not include incomplete paths which my program does right now.

Incomplete paths can also be trimmed to further reduce the space. But since incomplete paths each add only a single leaf node to the tree, and might be useful for various use cases I decided to keep it.


Another Freebie...

This problem was asked by Facebook.

Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.

For example, the message '111' would give 3, since it could be decoded as 'aaa', 'ka', and 'ak'.

You can assume that the messages are decodable. For example, '001' is not allowed.

RT @FungalSquirrel@twitter.com
Wife sent me this fig and asked if scientists would find it funny.

I dunno about you, but I giggled until I wheezed.

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.