David Vedvick

It's been coded

Drag And Drop Difficulties

It is surprisingly difficult to get drag and drop working in jetpack compose. I have had it working in most parts of the list for most of the week, but the first element causes the LazyList to readjust its bounds, causing absolute chaos. A fix I discovered in Google's examples partially helps, but still leaves the dragged element in limbo:


Note posted on Thursday, April 27, 2023 6:56 AM CDT - link

April 13th, 2023

Good source code requires other developers know as few assumptions as possible.

Note posted on Thursday, April 13, 2023 7:51 AM CDT - link

March 12th, 2023

Fixing an Annoying Connection Issue

Currently really trying to nail down initializing a connection to a media server with project blue, so that it is portable and hopefully transitions easily to Jetpack Compose and navigation. I wonder what the best way is to initialize connection state? Here's my requirements:

  • If initializing the connection fails, need to send user to settings.
  • If no media server connection is selected, send user to the settings.
  • If initializing succeeds, continue normal execution.

This piece of code has also caused me numerous, hard to track issues for years, so if I could make as much of it as testable as possible, then this would be a win. My current idea is to do this:

  • Have an interface ControlConnectionInitialization that defines a single function, promiseInitializedConnection(libraryId: LibraryId): ProgressingPromise<BuildingConnectionStatus, IConnectionProvider?>, through delegation, I can build up different behaviors as needed.
  • Have a simple implementation of this interface that just proxies the connection:
class ConnectionInitializationProxy(
    private val manageConnectionSessions: ManageConnectionSessions,
) : ControlConnectionInitialization {
    override fun promiseInitializedConnection(libraryId: LibraryId): ProgressingPromise<BuildingConnectionStatus, IConnectionProvider?> =
  • Have another implementation of ControlConnectionInitialization that handles error state and routes the user to the settings in failure. This will be passed an inner ControlConnectionInitialization, which we will assume is handling the basic connection (and maybe success case).
  • At the top level, have another implementation of ControlConnectionInitialization which handles the normal execution states, and delegates error-handling to the error-handling implementation.

I finished this work in this pull request.

Note posted on Sunday, March 12, 2023 11:35 PM CDT - link

February 23rd, 2023

Steps to Overlaying One Image over Another (And a Log of How I Solve a Problem)

  1. Start off with a div with two images in it. Both images are rendering, the "overlay" is under the base image as expected. Checkpoint.
  2. Set CSS style on "overlay" image to position: absolute, top: 0, bottom: 0, observer "overlay" effect. Checkpoint.
  3. Now pursue fitting image inside of box that takes 50% of document width.
    1. First try setting containing div CSS style to width: 50%.
    2. Notice overlay image is still taking 100% of parent's parent, but the "base" image is properly positioned. This is half of what we want.
    3. Try using position: relative on overlay image. Doesn't work.
    4. Research: "position absolute image does not use parent element box sizing".
      1. Click first link, most suggestions just suggest using pixel-wise adjustments, which we can't use.
      2. Notice some answers are suggesting parent container should use "relative" positioning. What is that about? Probably nothing, let's look into some other options.
      3. So far research seems to not be giving many great options...
    5. Try adding CSS style display: inline-block to overlay image. This does nothing.
    6. I noticed some of the other places where this worked, the parent container was a "flex" container. We can do this by setting the parent container's "display" property in its CSS to "flex" - so add this to the parent div CSS style: display: flex.
      • This has no noticeable effect.
    7. Ok, playing around has so far not given me any good results. Let's return to the research I had open. The fourth result was from a blog post on "solodev.com". It too mentions setting the parent div positioning to relative. Maybe there's something to this? It's a quick thing to try, so let's try it.... success! Just what we wanted.

Note posted on Wednesday, February 22, 2023 6:17 PM CST - link

January 31st, 2023

Rebasing Large Patches

Rebasing steps after many merges from the base branch into the target branch:

  1. Create a new branch for the rebasing work.
  2. Do an initial rebase without modifying the branches history - the goal is to purely update the target branch to be based off the new base commit.
  3. Compare the tree of original branch and the new "rebase" branch, ideally, if the original branch was up-to-date with the target branch, then the "rebase" and "original" branch file trees are identical.
  4. Now that the rebase branch is based off the new base commit, do another rebase, making whatever changes you want to the branch.

Dark Mode

"Dark mode" should really be thought of as "dark gray mode". Some of these UI designers go full black, and in my opinion, it's even harder on the eyes than white.

January 23rd, 2023

A fun read on the history of the metric system and the US: It's been 230 years since British pirates robbed the US of the metric system.

January 6th, 2023

Code should read from the top down, and it should tell you as soon as possible when you can quit reading.

January 5th, 2023

Now that the value of posting on a "status update" site has lessened (Twitter), I'm happy with splitting my posts between two different mediums:

  1. Topical content? Mastodon.
  2. Other content? My notes.

Note posted on Friday, January 6, 2023 4:23 PM CST - link

December 29th, 2022

It took me a long time to realize the Rx libraries [0] are most useful for UI state and not useful for data access (and perhaps even harmful). For data access, traditional pulling/enumerating methods should be used, but for UI state, Rx observables are downright magical.

[0] "Rx Libraries" refers to the libraries published on https://reactivex.io/

December 12th, 2022

One area where software testers can add value is in providing an external voice questioning software requirements. I think this value addition is best achieved when the tester is truly neutral to the product.

Note posted on Monday, December 12, 2022 3:02 PM CST - link

November 13th, 2022

The power of the Fediverse is that there can be a mastodon instance that has all verified, paid accounts, and there can be instances that are all anonymous accounts. The biggest risks I find with the Fediverse concept is that governments can more easily pressure, infiltrate, etc. small instances, not that this doesn't happen with Twitter as well.

Anyways, my Fediverse account is on Fosstodon now.

November 3rd, 2022

Microsoft has a command line upgrade assistant to help with porting .Net framework to .Net core now - https://dotnet.microsoft.com/en-us/platform/upgrade-assistant. I wish this had been available when I ported 60+ .Net framework projects to .Net core 2.2!

Note posted on Thursday, November 3, 2022 6:26 PM CDT - link

October 13th, 2022

Software is too easy to change, which makes it easier to make breaking changes. This is another reason to add unit tests - to make code that is performing its function hard to change in the wrong ways.

October 9th, 2022

project blue File Properties Editor

The file properties editor should popup a dialog when a certain property is touched, and the user should then have to initiate editing by clicking a button - it should be difficult to change such data through a User Interface.

Integration Tests

An issue with higher level integration tests is that the implementation of a method becomes intertwined with its usage.

Note posted on Sunday, October 9, 2022 10:58 AM CDT - link

September 16th, 2022

September 14th, 2022

One day, the ultra wealthy, taking the baton from generations of the ultra wealthy who preceeded them, will attach giant rockets to the earth's moon and fly away, living their lives in hermetically sealed environments and enjoying the Earth as they thought it should be in their VR metaverse. In true keeping with their predecessors, they will leave cleaning up the mess created by their action to the less fortunate left behind (losing the moon would destroy Earth's ecology in many ways). I have a hard time deciding whether I am making a joke or not 🤔.

Note posted on Sunday, October 9, 2022 10:53 AM CDT - link

August 20th, 2022

MUT = module under test. Fun to write, read, and say, and generic enough to describe any level of test, while also specific enough to connotate this is local code under test. Also, a "mutt" is a canine breed of many different types, which I think fits well with "module under test" as well.

August 18th, 2022

A defect is ordering a Big Mac with Cheese and receiving a Big Mac without any cheese. A critique is saying "boy this sandwich could really be improved with some barbecue sauce." This may seem obvious, but the latter is not a defect, it's a new requirement.

August 17th, 2022

Presentations follow a general format of 1) give presentation, and 2) question and answer. If the same presentation is presented multiple times to different audiences, then the Q&A tends to differ, out of which a "Frequently Asked Questions" list can be compiled. I wonder if there's a way to formalize this approach with existing presentation software (Powerpoint would be nice, but it would be easier to build something off of OS Markdown based presentation tools).

Note posted on Wednesday, August 17, 2022 10:59 AM CDT - link