How do you familiarize yourself with a codebase?

Here is how I do it:

  1. Find a some small scope that is relevant to my work. A recent example is SSO workflow in an open source project we use at work. I make sure to always pick a "leaf" for this task and not a trunk like index.php with a vary deep and wide dependency tree.
  2. Figure out the intended behavior and write a unit test for it (very rare for me to see code that is well covered). Sometimes I have to refactor the code to make it actually testable.
  3. When tests pass, I feel comfortable making changes. I begin with removing redundancy - removing unused imports. Consolidating a wall of if statements to a match/switch.
  4. Make a PR. Carefully go through any code review/feedback I get from the maintainers.
  5. Rinse and repeat until I get a good grasp on the project.

Thoughts? I haven't worked in big teams before so I don't know if my approach is common or not. I personally don't know how to understand something without actively interacting with it.

reddit.com
u/BigBootyBear — 3 hours ago

Are funtions a thing or a process?

Code uses functions as a process. Example in python

def  sum(a,b):
  return a+b

When you are introduced to functions in high school, the visual aids show them as a cartesian product of domain over co-domain.

In common parlance, a function is a process rather than a thing. A toaster has a toasting function. A car drives. However in set theory functions are considered to be sets (i.e. a thing). But in category theory, a function is a morphism (and morphisms are the abstract concept of a process or operation).

So is function form, utility, or form AND utility at the same time?

reddit.com
u/BigBootyBear — 4 days ago

Should Ansible be used for local development?

I've considered getting rid of many scripts and vscode tasks in favor of adding a dev.yml inventory that deploy everything locally on my machine.

However i've been meeting plenty of problems. I need to add conditionals on various tasks that need privilege escalation (such as nginx restart). I need to add permissions for various processes on my machine, and generally uproot a lot of my (already working) playbooks workflow.

I don't know what to make of this. Is the recent inclusion of localhost exposing flaws in my playbook and task design. Or am I now realizing Ansible wasn't built with local devlopment in mind and I am trying to fit a square peg into a round hole?

reddit.com
u/BigBootyBear — 6 days ago

Reasonable timeframe for a PR to get merged?

Considering your PR addresses an existing issue, or solves a bug. It passed all CI checks and maintainers commented LGTM. In what timeframe does it usually get merged into main?

I'm asking because i'm seeing 1-2 week wait time on a project i'm a contributor of (which we use at work so naturally I contribute) and it's really slowing me down.

reddit.com
u/BigBootyBear — 7 days ago

Do daycare subsidies make daycare more affordable?

It seems like a redundant policy that doesn't actually make childcare more affordable giving the following premise:

  1. The cost of daycare is more salient compared to every other costs to warrant attention & policy change by the governemnt. I.e. daycare is expensive.
  2. Daycare has little "residual supply". If daycares were at 75% or 90% capacityl, they would lower prices. Like movie theaters and airlines, there is little marginal cost for butts in seats since most of the cost is is built in whether a daycare serves 1 or 30 children. So if daycare is expensive, it must be at full capacity since if it werent so, they'd lower prices (like an airline).
  3. Everyone that gets the subsidy bids for the limited supply good (i.e. daycare) against people who also got the subsidy.

Considering the 3 premises, any subsidies we give to parents for "daycare" must cancel themselves since they don't confer a comparative advantage in the market. The subsidy couldn't "elevate" anyone that got priced out of the market since they'd would need to take someone elses spot. A general subsidy could make childcare more affordable since it would confer the parent a comparative advantage against non-parents who don't get the subsidy since not everyone who buys food is also a parent (but anyone who bids for daycare is one).

Is this true? Where could I be wrong? It seems like these subsidies just get captured by daycare owners and would be better allocated as grants for building more daycares.

reddit.com
u/BigBootyBear — 8 days ago

Is {⊂, ⊆,⊊} true?

I've googled, read various wiki articles and still confused about which symbol means what, and if they all carry a distinct meaning (or one is redundant).

As far as I understand it, inclusion between A and B has the following 3 states

  • There exists at least y in B that is not in A. Therefore A is a proper subset of B. [A]<[B]
  • For any x in A and for every y in B, x =y. A =B and [A] = [B]
  • For any x in A, x can be found in B. Equality is yet to be determined. So kind of like a schrodingers subset.

Being each state is unique and mutually exclusive, one could make the claim that set inclusion looks like {⊂, ⊆,⊊}. Now if proper subset is A ⊊ B and a non proper subset (equal) is A ⊆ B then do have a term for "yet to be determined proper subset"? Cause i've only two terms used to describe a situation which has 3 (predetermined, equal, non-equal).

reddit.com
u/BigBootyBear — 13 days ago

How do you submit multiple PRs that build on top of each other?

My use case is as follows:

  1. I get silent OAuth failures on an open source web app I am a contributor of. Obviously I need to go into auth-dispatcher.php and add a few exceptions, log stuff etc.
  2. The code is a bit messy with no unit tests. I don't want to step over myself so I write unit tests. Then I refactor auth-dispatcher.php to make it testable.
  3. All tests pass. Now I want to cover this with E2E so I add playwright to the project with a few smoke tests and a README.md to familiarize the tool with the team.
  4. I can now cover /google/authorize requests with E2E. For good measure I also cover facebook, github and Azure OAuth.
  5. Now covered with unit tests AND E2E I feel I have the freedom of movement in making more ambitious improvements to authentication, addressing bugs & issues.

My problem is that each of these PRs is sequential. Doing everything in 1 PR is scope creep and makes code reviews a pain. Waiting for each PR to get merged before working on the new item in my todolist breaks flow and compounds how fast me and our org can iterate.

Do you have any suggestions? I think I should branch PR2 from PR1 , and once the previous PR gets merged into main, I resolve any conflicts and then rebase PR2 into main.

u/BigBootyBear — 15 days ago

Is 0.5 a facde over 1/2?

Could you say 0.5 is a facade or a pointer to 1/2? Or all numbers of the 0.n form are rational number pointers?

In my head, 0.5 seems to be pointing towards 1/2 like how 'a' points to 97 in ASCII.

*Posted in ask computer science since i'm using computer science examples which people over at r/askmath may not be familiar with.

reddit.com
u/BigBootyBear — 22 days ago

How to optimize for silence on a humidifier that uses a water pump?

Couldn't find an evaporative humidifer where I live so I built one myself based on this design.

It works but turns it it's really loud. For my project i've used a Seaflow 350GPM Bilge pump. I think my choice of pump was the problem so before I am looking to replace it, i'd like to learn a little more about pump choice when optimizing for loudness (or lack of). Also, maybe I should pad the humidifer?

I just need a 1-2m water lift for the project.

u/BigBootyBear — 24 days ago

Is it true that my mains power can torpedo Arduino projects with it's noise?

I'm trying to run simple vibration sensor (SW420) demo that already worked on my uno 3 on an ESP32. Here is my code

#include &lt;Arduino.h&gt; 


#ifdef ARDUINO_AVR_UNO
  #define VIBRATION_PIN 2
#elif defined(ARDUINO_ESP32_DEV)
  #define VIBRATION_PIN 5
#endif
void setup() {
  Serial.begin(115200);
  pinMode(VIBRATION_PIN, INPUT);
}


void loop() {
  int state = digitalRead(VIBRATION_PIN);


  if (state == HIGH) {
    Serial.println("Vibration detected!");
  } else {
    Serial.println("No vibration.");
  }


  delay(100);
}

[env:uno]
platform = atmelavr
board = uno
framework = arduino
monitor_speed = 115200
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200

It works fine on my uno 3. Running on ESP32 however spams my terminal with "Vibration detected!" or "No Vibration" a bazillino times a second even though delay is only 100ms.

Claude says that my mains voltage 50Hz hum creates noise that gets picked up by the ESP32. It sounded crazy to me, so I made an experiment and wrapped my ESP32 (and the breadboard with its sensor) in a plastic bag that I wrapped with aluminum foil to make a faraday cage.

I'm still getting those spammy messages. So is Claude gaslighting me? I understand a faraday cage would minimize the mains noise.

reddit.com
u/BigBootyBear — 25 days ago

Subreddit with photos of naturally aging people/celebrities

I've recently figured out I forgot how men/women look past the age of 20 if they don't do anything (surgery, botox etc). And it's not like i'm that young (90's kid).

reddit.com
u/BigBootyBear — 25 days ago

What's a "Linux global system resource"?

I've heard the terms "linux global system resource" and "linux system resource" in the context of trying to wrap my head around namespaces and I find them problematic.

First of all, isn't everything a "linux system resource" from namespaces to processes to files, drivers network interfaces etc? A category that is all inclusive has no meaning.

Or maybe were talking about "global system resources" but then again what makes a resource global and what are non-global resources?

reddit.com
u/BigBootyBear — 26 days ago

Do you find connections made with male header pins to be unreliable?

After buyring and Arduino uno R3 (I had ESP 32s) I've noticed male jumper wires connected to the arduino female headers make much better connections than female jumpers connected to a male header pin on my ESP32. I always have to re-seat the latter a couple of times. And half of the time the connection is so wobbly it just comes off whenever I move the board around.

I wonder if that's just a fact of electronics and its best to always solder female headers and use just M-M jumper wires. Or maybe my female jumpers (or male headers) are of a poor quality. Need some input on this.

reddit.com
u/BigBootyBear — 28 days ago

Is resting state a physical property, or a mental model?

I've been reading about how the equilibrium point in a sound wave is the "resting state" of an air molecule. But before the sound wave, that particular air molecule wasn't static. So how a non-resting entity have a rest state?

It sounds like "rest state" is like an abstraction or a mental model, but is not a "real" thing like a mass or acceleration.

reddit.com
u/BigBootyBear — 1 month ago

ESP32 GPIO outputting negative voltage — what's going on?

ESP32 soldered pins:

Left:

  1. TXD
  2. RXD
  3. IO22
  4. IO21
  5. IO17
  6. IO16
  7. GND
  8. VCC
  9. TDD
  10. SDD

Right:

  1. RST
  2. SUP
  3. IO26
  4. IO18
  5. IO19
  6. IO23
  7. IO5
  8. 3.3V
  9. TCK
  10. SD3

Wiring:

  1. GND → breadboard - rail -> Multimeter black probe
  2. GPIO22 → breadboard + rail -> Multimeter red probe

Test 1 — pinMode only:

#include 
constexpr int BUZZ = 22;

void setup() {
  pinMode(BUZZ, OUTPUT);
  // digitalWrite(BUZZ, HIGH);
}

void loop() {}

Multimeter shows -3.6V


Test 2 — with digitalWrite(HIGH):

#include 
constexpr int BUZZ = 22;

void setup() {
  pinMode(BUZZ, OUTPUT);
  digitalWrite(BUZZ, HIGH);
}

void loop() {}

Multimeter shows -384mV


Notes:

  1. Multimeter probes are not swapped
  2. Multimeter confirmed working fine on batteries and other measurements — this is the only time I'm getting a negative reading

Why am I getting negative voltage? Why does digitalWrite give me 384mV?

reddit.com
u/BigBootyBear — 1 month ago
▲ 3 r/devops

How to elegantly include a static docs site in your projects CI?

I have my vitepress docs site as a submodule under ./vendors/docs in the project it documents (alongside a few other quadlets services). I want to include it in a build-docs stage in my gitlab-ci but GIT_SUBMODULE_STRATEGY: normal seems excessively heavy when I only care about the static .vitepress/build/dist.

I've googled and clauded but can't find a good answer. Thoughts?

reddit.com
u/BigBootyBear — 1 month ago

Why does Springer publish an alternative medicine journal? Isn't that an oxymoron?

Stumbled on the BMC alternative medicine journal and it made me raise an eyebrow. I'm not categorically against studying a herb. But what in studying herbs makes it an "alternative/integrative medicine" as opposed to studying a protein?

I once heard a physician say "The label of 'Alternative medicine' is misleading because it operates under the false premise that there are 'types' to medicine. If it's evidence based and it works that makes it medicine."

My BS meter tells me it's quackery because sectioning off a part of research into "alternative medicine" tends to bring with itself lax standards in basic academic common sense and good faith.

Thoughts?

EDIT: Board members are "cupping expert" and "Chinese/Korean traditional medicine" PhDs.

u/BigBootyBear — 1 month ago
▲ 29 r/devops

Wait time for firewall inclusions is slowing me down. What am I doing wrong?

I'm in the process of laying down an infrastructure & CI/CD pipeline in our company (all of our deployments were manual until I got fed up with manual work and pitched CI/CD) for the rollout of a new version of a legacy app.

On multiple occasions I'm deep in a flow state, then I see "Connection refused" and realize I have to open up a ticket, then physically visit 2-3 offices on multiple occasions to get it approved within the next hour (cause then I may have to wait a day or two).

I could be asking for all the ports at once. But later down the road I always go like "Oh yeah the VM also needs to access gitlab, not just my PC" or "Oh yeah port 5050 needs to be released as well for the container registry on gitlab". Maybe theres a certain methodology I'm missing, id like to hear peoples thoughts.

P.S: I'm a junior DevOps (i.e. literally hired as a full stack and ended up doing DevOps) so everything im doing ATM (CI/CD, quadlets, ansible, automated E2E etc) is done either for the first time ever working with the tool, or working with the tool in a production setting.

reddit.com
u/BigBootyBear — 1 month ago

How much can you trust aliexpress supplies?

Getting into soldering and need to stock up on supplies. Already ordered a weller 1010 and need solder, flux, brass cleaner etc. Amazon isn't available ATM so I think about Aliexpress.

Can you trust aliexpress sellers that a given solder alloy is actually what it says it is?

reddit.com
u/BigBootyBear — 2 months ago

How to achieve a clean cross section on a lasagna?

I want my lasagna to have a clean cross section that looks like this, with the filling staying in its place.

What parts of the recipe/technique should be changed to achieve this product? I'm looking for a general understanding rather than an ad hoc modification to one recipe as I work with a couple.

reddit.com
u/BigBootyBear — 2 months ago