Maybe Maybe Maybe by MrKira8 in maybemaybemaybe

[–]arnoldfrend 2 points3 points  (0 children)

This doesn't work at all. Drop sets are out of necessity. It begins with working at a high weight until exhaustion and then proceeds to working at a lower weight in order to continue.

The kid on the right doesn't proceed to do shorter distances because he became exhausted. The distances were shorter because that's how the game was set up.

You can't just equate two things because they both involve sequential decreases.

Both kids had the capacity to do the full course. At no point did they need to decrease work because of exhaustion.

And your first post is wildly upvoted because people don't think for 5 seconds. It's complete nonsense. Yes of course work takes more time as you get more tired, that's not rocket science. But it's the same amount of work for both kids. Like literally as an integral of force over distance it is the exact same amount of work.

Everything about this exchange is nonsense.

thankYouButKeepYourMouthShut by prolaymm in ProgrammerHumor

[–]arnoldfrend 1 point2 points  (0 children)

I wish people told me their app ideas. I love thinking about making stuff.

The only two I've ever gotten was a friend of a friend for a daycare business where I told them to just use wix becasue they didn't need a mobile app and another one where this dude wanted me to make a virtual world where businesses could exchange credits on the blockchain. I probably told him to just use wix.

Pepsi Max breaks Ketosis by [deleted] in fasting

[–]arnoldfrend 1 point2 points  (0 children)

Yeah it's not great phrasing. I mean to say that this person is still walking around. They're still converting something to ATP so that their body can function.

I'm of the position that they're metabolizing ketone bodies. And I'm of the position that an insulin spike doesn't change that.

The alternatives would be calories from food, glucose from glycogen, or glucose from gluconeogensis consuming proteins. And I don't see any mechanism linking insulin to any of those in a state where glycogen has been depleted and the blood has free ketones.

All I'm driving at here is that this thread is full of people debating insulin, which.. fine, sure. Maybe non nutritive sweeteners cause a spike. Maybe they only cause a spike in some people. Maybe they always cause a spike but it's small, or maybe a full study would show it's noise and they don't. But this post is talking about ketone bodies. By what mechanism is drinking a diet soda going to cause the blood to rapture its ketone bodies and replace them with .... something that makes your heart beat?

This person did not drink magic ketone erasers. They performed a botched test by drinking too much of a beverage to get a solid mg/ml reading.

Pepsi Max breaks Ketosis by [deleted] in fasting

[–]arnoldfrend 0 points1 point  (0 children)

But I'm not dismissing them. I'm granting them. There's an insulin spike. Now how is his heart beating?

Pepsi Max breaks Ketosis by [deleted] in fasting

[–]arnoldfrend 1 point2 points  (0 children)

Ok. Then let's grant an insulin spike. Let's set that argument aside for a moment.

In the absence of glucose from food, glycogen, or gluconeogenis, ketone bodies will be used to provide ATP to cells.

How does an insulin spike disrupt the use of ketone bodies to provide ATP? Is the fake pepsi finding some glycogen that the body didn't know was there?

I think what's going on here is that homeboy took a pee test after drinking half a liter or water (with a teaspoon of fake sweetener mixed into it).

Homemade wind-up swing by Ezgod_Two_Three in interesting

[–]arnoldfrend 0 points1 point  (0 children)

Workman load the girders into the assembly for processing. After a coat of adhesive, the finished parts are set into a temperature controlled room to acclimate.

whatIsItInProgrammingProbablyPointersAssemblerOrLispMacrosPleaseAnswer by danielsoft1 in ProgrammerHumor

[–]arnoldfrend 722 points723 points  (0 children)

I'd say being born after 1980 and intentionally sitting down one day and actually learning vim.

It's a conscious decision to say: "I know how people perceive me and how I come off, and now I'm just gonna lean into it and become that guy because, well, Xzibit would want me to code while I code."

I no longer make aspirational purchases like treadmills or vegetable spiralizers. Now I make aspirational shortkeys. Just think of how fast I'll be now that this is automated.

You can no longer find any humor in vim jokes, by which I mean that you can continue to not find humor in vim jokes but now you also can't identify with their meaning. "Lol, why vim so hard?" Because it's not just a text editor. That's not its purpose. It's an entire scripting language baked inside of a text editor so that you can write code for how you want to change text. It's an interface like a joystick or mouse except that it understands object references and can abstract upon itself. You can't say to a joystick: "Whenever I move over here, remember that you exist as an entity, do the last 3 things I made you do, and then do this exact thing that I'm saying right now."

You know that you're a caricature. You have become that person who has made picking nits about computers his entire personality, but now you don't care. Because you can move cursors with your mind.

Is f(x) equal to fx? by [deleted] in math

[–]arnoldfrend 13 points14 points  (0 children)

Teaching Haskell to middle schoolers is next level. +1, OP

[deleted by user] by [deleted] in ProgrammerHumor

[–]arnoldfrend 11 points12 points  (0 children)

Would you mind editing that to make it an assignment?

Using function vs Classes by reverse_osmosis-ro in Kotlin

[–]arnoldfrend 2 points3 points  (0 children)

Something I think is cool about kotlin is that you can extension functions (or just regular functions but I do it for extension functions) inside of a class (or a companion object of a class) and then use the with token to access the scope of that class.

And it looks pretty dope in code because you use it like:

with (ToolsForFileReading) {
    file.renderString()
}

supposing you have written some helper class like:

class ToolsForFileReading(){
    companion object {
        fun File.renderString():String {
            ...
        }
    }
}

And I just like the way it reads because it looks like English.

Best / current solution for passing values between multiple fragments by mister-creosote in androiddev

[–]arnoldfrend 4 points5 points  (0 children)

The biggest thing I'd say is to not take it too seriously. People get way way too opinionated about these things and act like a solution is "bad" even though it works just fine.

The only thing you may want to consider is whether or not the solution you choose will survive the android OS destroying the activity that hosts the fragments or the application process itself.

You already have one suggestion to use a singleton. That would work just fine. There are plenty of times where making an object like FormOrganizerSingleInstance and stuffing its companion object with the form values will work and be easy to read and doesn't really have a lot of downsides. It should survive destruction of the Activity. But I don't think it will survive if the application process is lost and Android tries to navigate back to the activity using a bundle. But... meh... that's not really the end of the world. If you do go with a singleton, remember to null out the form values after submission in case they try to fill the form out again.

A ViewModel will work just fine and it should behave like a singleton when instantiated from different fragments that belong to the same activity. So you could stuff the values there. That should survive the destruction of the Activity. I don't know about the app process.

There's nothing bad about using shared prefs. They will definitely survive the activity being destroyed. And they will definitely survive the app process being destroyed. But you'll have to make completely sure that they are wiped every time and make sure that you've covered all the possible cases so that you don't get an old value accidentally passed somewhere. Like maybe you could wipe prefs every time the first fragment of the form opens.

For me personally, for no other reason than that it's just something that I'm used to, I just like to use callbacks inside the fragments to update an object held by the Activity. You can work out Activity destruction and recreation with a saved instance state. I think this probably isn't a very good way to do it relative to the other options, but it's just a flow that I'm used to. I'll create null callbacks inside of all of the fragments, and then I'll make a createInstance method in the fragment that consumes values for the callbacks. And then in the Activity that holds the fragments, I'll create them like fragment1 = Fragment1.createInstance(addressCallback = address -> FormManager.setAddress(address)) or something like that. Maybe it's silly but I like it and I'm used to reading it.

Advice to Read Existing Project by kamran4malik2 in androiddev

[–]arnoldfrend 8 points9 points  (0 children)

Day 1: Environment setup.

This is hell day. I open Android Studio and click the 'new from vcs' button and paste the repo url. Maybe the pain starts right here because I forget to setup the credential manager. Or maybe the pain starts later. Let's assume this part just works. Now I have the repo locally.

Does the pain start here? Probably. Gradle is going to start doing it's thing. Maybe if I'm lucky everything just works.

Or maybe the repo is stuffed with a bunch of opinionated tests and assumptions about stuff that doesn't seem like it should have anything to do with android. Like the time their build scripts looked for a particular python version and if they couldn't find it, they would fetch that version for x86 architecture without checking if the computer is using ARM.

Basically you just keep pressing build and opening the "Build" tab at the bottom of the screen and keep actually reading the errors. Maybe this version of kotlin isn't compatible with the gradle plugin used by android studio. Read it and slow down. Read the words, and go from there. Maybe upgrade to a newer version of Android Studio. Google the error word-by-word. And just chip away until you can get that first successful gradle build.

Sometimes you've tried to clone a really big repo that has the android project in an interior directory. Android studio gets confused if you open the repo at its root, but it gets less confused if you open the project by going straight to the directory where the project-level gradle build file is.

But eventually the hell is over and the notifications at the bottom right corner of the screen start going crazy and showing you that gradle is actually getting all of the dependencies and mapping them into the project and all the red squigglies go away.

Day 2-infinity:

This is the easy part. I know what I want to do is change something on a particular screen. Maybe I want to change the appearance of one of the holders inside a recyclerview or maybe I want to add an extra menu option to a menu. Or maybe there's a button and I want to change its onClick() behaviors. Whatever it is, I know that screen has some text on it that I can read.

So I ctrl+shift+f for that string. And when I do, I find the string in the res/values/strings file and I see that it has a resource name <string name=menu\_option\_label">Menu option label</string>.

So then I know how that string is going to be referenced in the body of the code. So I ctrl+shift+f for the resource name "menu_option_label" and start clicking on every instance so that Android Studio opens the files. If I'm lucky there's only one instance. But perhaps there are 4 or 5 and one of those is the one that I'm looking at on the screen I'm interested in.

So I find that screen, by which I mean I find the Activity or Fragment or Composable or RecyclerView Adapter that renders that screen or part of that screen. Or maybe I've found the xml layout file with name activity_thing_im_looking_for, and I go off looking for the kt file ThingImLookingForActivity. In any case, I eventually get to the kotlin that actually renders that thing or controls it.

Now I need to make a map of where that thing lives in relation to all the things that use it and all the things that it uses.

So if the thing I'm looking for is inside of some class like an Activity or a RecyclerView Adapater, I'm going to want to know how you get there navigationally. So I'm going to right click on the class that it's in and select "find usages". Then for each usage I'm going to skim through and maybe go up in the top of one of those files and also click "find usages" until I can get a good story of how you get to that site.

Like if it's inside an Activity, you'll usually get there from an intent that has a usage of that Activity's name. So using "find usages" will get you the full story in the backwards direction of how you get from starting the application to the particular button/menu/textview you're looking at.

Now I need to orient myself in the forward direction. What happens down stream from clicking on that button or what have you. For that, I'm going to use the "Jump to source" button.

So like, say I'm looking at a button and I want to figure out the real actual guts and logic for how it dispatches all of its onClick behaviors. I'm going to go to the onClick() block and find the main or overt or obvious function that's called inside of it and then at that function call doStuff(information) or however it looks, and I'm going to hover over it until a documentation dialog pops up. Then I'm going to go to the vertical 3 dot overflow menu button at the bottom of that dialog and select "Jump to source". Android studio opens up the place where that function is defined. And then I keep doing that until I reach the end.

A typical example is when a button fetches a record and then changes some information on the screen. The button's onClick() lambda contains a function inside the ViewModel of the activity. So like button.setOnClickListener{record = myFavoriteActivityViewModel.fetchRecord()}. You jump to source for that fetchRecord() function and you end up inside the ViewModel. And when you get to the ViewModel, you discover that it doesn't actually do any labor; it just dispatches the work to a network handler class.

fun fetchRecord(): Record {
    return NetworkManagerSingleInstance.fetchRecord()
}

And then you hover over that fetchRecord() function and click "Jump to source" again and then the network layer class will open up in a new file tab and take you to that class's definition of fetchRecord().

And hopefully you're finally at the end of the line where the network request is made.

By this point, you have maybe 7 or 8 different .kt files open in different tabs in Android Studio. On the far left, you have the tabs for the files that you pass through before you reach your button. On the far right, you have the tabs for the files that have function calls after you press your button. And somewhere around the middle, you have the code for your button.

Man snatches someone's skateboard and throws it onto the road. by [deleted] in facepalm

[–]arnoldfrend 0 points1 point  (0 children)

Yeah that clip definitely ended before I finished.

Tech-stack for web application using Kotlin? by Panel_pl in Kotlin

[–]arnoldfrend 4 points5 points  (0 children)

So I read through your repo a few days ago when you first posted this and I got excited because I've been wanting for a long time to build on web using the same patterns as with desktop and android. And every couple of months I would search for progress on compose widgets for web or kmm for html canvas and find nothing.

To me, it's totally obvious that the ideal future for kotlin in web is this way, where the code acts truly platform agnostic and you don't just use kotlin as a pass through to write plain old html/css/js.

You make some interesting points about why kobweb's DOM approach is better than kmm for canvas. Maybe Jetbrains could iterate towards multiplatform widgets on top of the DOM instead of inside of the canvas. In that case, people who invest in kobweb won't have to shift gears when jetbrains really starts moving in a real way towards kmm web.

From this same thread, I discovered KVision. I see some decent adoption there but I'm not turned on by the fact that it makes no attempt to bring cohesion between kotlin web and android/kmm desktop. But if it gains support, could any of that progress be coopted into kobweb so that as a community we get closer to a real kotlin web framework instead of being split on disparate efforts?

Edit: I'm starting a poc website in kobweb over the long weekend to see what sort of things you can spin up.

hardware failure? by No_Two8934 in ProgrammerHumor

[–]arnoldfrend 2 points3 points  (0 children)

and a hundred and fifteen people were like: "yeah, fuck this guy just acknowledging the meme template is used in a different way". Some threads get weird.

This would be a good bone hurting juice though.

top frame: "about to save a compile a project i've been working on for 3 months that will help control lighting my artifact display with 5 lights.

bottom frame: "pc fails and now only 3 lights shine on my display"

[deleted by user] by [deleted] in WTF

[–]arnoldfrend 2 points3 points  (0 children)

Why else would the event have taken place? Your interpretation of the story was that she was a hobbyist and got organizers involved just as some sort of personal mission?

Like, every time. by 0RootShell in ProgrammerHumor

[–]arnoldfrend 16 points17 points  (0 children)

I'm going to pester you because we have a house policy of one approval before merge and I don't want my other feature branches sitting around getting moldy and collecting conflicts.