Built this quick-and-dirty, very questionable but quiet linear power supply for avoiding RFI from SMPS. Takes power from an old AC wall-wart, no large heatsink, so I used a ton of dropping diodes just to prevent the LDO from overheating itself.
> The use of 9 diodes and a power-wasting resistor delivers unprecedented scale of system inefficiency, ideal for radio amateurs who have too many junkboxes, free energy advocates and climate-change deniers alike!
@Absinthe I have a feeling the emoji meant something more suggestive (like peach and aubergine), but there's some nice recipes on Bing : https://www.bing.com/search?q=Aubergine+and+taco
I shall be lazy and only do a freebie.
This problem was asked by Microsoft.
Given a 2D matrix of characters and a target word, write a function that returns whether the word can be found in the matrix by going left-to-right, or up-to-down.
For example, given the following matrix:
[['F', 'A', 'C', 'I'],
['O', 'B', 'Q', 'P'],
['A', 'N', 'O', 'B'],
['M', 'A', 'S', 'S']]
and the target word 'FOAM', you should return true, since it's the leftmost column. Similarly, given the target word 'MASS', you should return true, since it's the last row.
And this seems appropriate as well:
"And the days that I keep my gratitude higher than my expectations
Well, I have really good days" Mother Blues ~ Ray Wylie Hubbard Listen!!
Python Solution: Not the best, but the best I could come up with since I already saw someone else's solution and didn't want to just copy it :(
Works now, but more like the code I didn't want to copy :)
Python Solution: Not the best, but the best I could come up with since I already saw someone else's solution and didn't want to just copy it :(
Never Mind. That doesn't work.
Python Solution: Not the best, but the best I could come up with since I already saw someone else's solution and didn't want to just copy it :(
Okay, here is a fun one. We've all seen Fibonacci sequences. But they are all played out. Let's look at a different sequence. They are called Hamming Numbers after Richard Hamming, who proposed the problem of finding computer algorithms for generating these numbers in ascending order.
For number H is equal to 2**i * 3**j * 2**k where i,k,k are all non negative.
For example
2**0 * 3**0 * 5**0 = 1
2**1 * 3**0 * 5**0 = 2
2**0 * 3**1 * 5**0 = 3
2**2 * 3**0 * 5**0 = 4
2**0 * 3**0 * 5**1 = 5
2**2 * 3**1 * 5**0 = 6
2**3 * 3**0 * 5**0 = 8
So hopefully that explains what the sequence looks like. Your challenge, if you choose to accept it is to generate the first 25 of them. An arbitrary nth one such as 1700th. And given a number X determine if it is or is not a valid hamming number.
Here is the wiki article on them:
#toyprogrammingchallenge
okay, here's a freebie!!
This problem was asked by Facebook.
Given a multiset of integers, return whether it can be partitioned into two subsets whose sums are the same.
For example, given the multiset {15, 5, 20, 10, 35, 15, 10}, it would return true, since we can split it up into {15, 5, 10, 15, 10} and {20, 35}, which both add up to 55.
Given the multiset {15, 5, 20, 10, 35}, it would return false, since we can't split it up into two subsets that add up to the same sum.
@Absinthe
Yep! Like I said, my implementation treats the board as functionally infinite as cells grow towards the borders
#toyprogrammingchallenge #GameOfLife
This was a fun one! Written in Ruby, I decided on treating the board size as infinite by expanding it whenever the first or last row or column has an alive cell.
The entry file is game_of_life.rb in the root directory, and for simplicity, it just runs the "small exploder" pattern instead of taking an argument for initial state.
Okay, here is a fun one. We've all seen Fibonacci sequences. But they are all played out. Let's look at a different sequence. They are called Hamming Numbers after Richard Hamming, who proposed the problem of finding computer algorithms for generating these numbers in ascending order.
For number H is equal to 2**i * 3**j * 2**k where i,k,k are all non negative.
For example
2**0 * 3**0 * 5**0 = 1
2**1 * 3**0 * 5**0 = 2
2**0 * 3**1 * 5**0 = 3
2**2 * 3**0 * 5**0 = 4
2**0 * 3**0 * 5**1 = 5
2**2 * 3**1 * 5**0 = 6
2**3 * 3**0 * 5**0 = 8
So hopefully that explains what the sequence looks like. Your challenge, if you choose to accept it is to generate the first 25 of them. An arbitrary nth one such as 1700th. And given a number X determine if it is or is not a valid hamming number.
Here is the wiki article on them:
@Absinthe Had to rewrite because I forgot an important test case. Here's snail sort in Rust... again: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4ba0f21a08b05e70e979f855dd530117
@Absinthe
Related to #toyprogrammingchallenge, I thought this was a good read!
https://jvns.ca/blog/2019/11/20/what-makes-a-programming-exercise-good/
The green faerie