Interesting examples of locally constant functions ?

What are some interesting examples of locally constant functions over spaces with disconnected components (since locally constant functions are constant over connected domains) ? I'm especially interested in cases where the domain is p-adif or more generally some kind of Stein space.

P/s: Bonus points for L2-functions.

πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/hau2906
πŸ“…︎ Jul 24 2021
🚨︎ report
Testing Lambda functions locally
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/TastefulElk
πŸ“…︎ Jan 29 2022
🚨︎ report
QUESTION: how to run google functions locally for testing?

Hey group,

I am new to Google Cloud Functions and have been tasked with refactoring some for my job.

Problem:

  • I want to trigger a series of cloud functions locally for test purposes

Attempted Solution:

  • I installed the functions_framework and have attempted to run it in terminal but am getting an error.
  • I have imported functions_framework into my main.py module
  • I'm using the <@functions_framework.http> annotation on the function I want to trigger

Error:

  • OSError: Project was not passed and could not be determined from the environment.

Thoughts:

  • I'm wondering if I need to config gcloud to work with a given project.

Help appreciated. Thanks

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/Corvoxcx
πŸ“…︎ Dec 28 2021
🚨︎ report
Measurable functions are almost locally bounded

Exercise: Let f be a measurable function from R^d to C that is supported on a set of finite measure and let Ξ΅>0. Show that there exists a measurable set E of measure at most Ξ΅ such that f is locally bounded outside of E.

Solution attempt: Let n be a positive integer. Then there is a compactly supported continuous function g such that (the L^1 norm) ||f-g||< Ρ/2^n . The set E(n)={x in B(0,n): |f(x)-g(x)|>1} has measure ∫_{E(n)} 1 leq ∫_{E(n)} |f-g| < Ρ/2^n . Since g is continuous on the closed ball B(0,n) and this ball is compact, so there is some real number M(n) such that |g(x)|<M(n) for all x in B(0,n). If x is not in E(n) then |f(x)| leq |g(x)|+1 <M(n)+1.

If E is the union of all E(n), then its measure is less than Ξ΅. Given any positive real number r, let R denote the next integer larger than r. The map f is locally bounded outside of E because |f(x)|<max{M(1),…,M(R)}+1 for all x outside of E.

Is this a correct solution? If not, where is the problem?

πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Jan 04 2022
🚨︎ report
I think I have some type of strange neurological function in which I'm in a constant state of bliss and ecstasy, anyone know of anything like this?

I'm a 28 year old male and since I was 17 I have been in a constant state of bliss and ecstacy 24/7. One day when I was 17 I woke up and just felt this bliss is my mid to lower spinal area. Over time it began increasing and getting more intense over the years. Now I feel it throughout my whole spine and brain but none in my arms or legs. I have some control over it but for the most part it seems to fluctuate in intensity on it's own.

I have not been sad or fallen into depression since it began. I also may be experiencing some type of anhedonia because things I used to enjoy just don't bring me as much pleasure. It seems nothing brings me greater pleasure than what I'm feeling. Also at times if I'm still for long enough the ecstacy will become so intense it's difficult for me to move. I don't take any supplements or medication.

Wondering if anyone knows of anything. Any thoughts?

πŸ‘︎ 107
πŸ’¬︎
πŸ‘€︎ u/Spinalblissontap
πŸ“…︎ Dec 29 2021
🚨︎ report
Python Function Returning Empty String Even Though String Is Locally Full

I have function that has a loop. In each iteration of the loop, it asks the user for input and adds that input to a larger string. So with each iteration, the string gets bigger. After the loop is over, the function returns that string.

I have done a print statement within that function and I can confirm the string is what I want it to be.

However in my main function, when I declare a new variable salad by assigning it that function, salad is blank. But the combo string inside the function has the fruits.

Why is this happening?

My guess is, when I write that assignment statement in the main function, the salad variable is immediately getting assigned with an empty string (since that's what the combo string starts out as)? How do I make it return the string only after the loop is over?

def main():
    salad = makeSalad()    





def makeSalad():
    combo="";    

    for x in range(0, 4);
    ingredient = input("Please enter the ingredient");
    combo = combo + ingredient;

return combo;
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/HyperactiveYak
πŸ“…︎ Nov 25 2021
🚨︎ report
How would I solve differential equations with these forms? (In both cases x is a function of t and I'm solving for x; all other letters are constants.)
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/greenpepperpasta
πŸ“…︎ Jan 28 2022
🚨︎ report
Redditors- Do any of you feel a constant feeling of tiredness, gloominess, and anxiety to leave the house? How do you function/cope?
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/stunes77
πŸ“…︎ Jan 13 2022
🚨︎ report
12 years ago I had a scoliosis spinal surgery and ever since I've had random debilitating back spasms that have severely limited my ability to do much physically. I am in constant chronic pain and when the spasms happen, I can barely function. Finding work is hard and I can't live off disability.

I'm 29 now and when I was 16 I got a scoliosis spinal fusion from T1 to L3 (basically two titanium rods fused to the entirety of my spine) severely limiting my mobility, but had I not gotten the surgery, my scoliosis would have gotten much more severe. I also would have had to wear a back brace 22 hours a day. The surgery was really my only option at the time. It corrected my curve from 54 degrees to 15 degrees.

Since then, I've had to manage my back pain. In the warm months, my pain is minimal, but I get pretty cold winters where I live and my pain gets so severe that I am locked in a very uncomfortable position and can barely move. The spasms come in and I feel like my lower spine is exploding. I usually smoke weed to help distract from the pain, but it never completely goes away. I've been prescribed very strong medication like vicodin but I'm careful with them because I get way less cognitive while on them and need to be aware during the day (I use indica weed as it's way more of a body high than a mind high).

I try walking and exercise but while it helps in the moment, the spasms come right back. I've had epidural steroid injections directly in my spine, but that only helps for a few weeks before coming back, and getting those injections is extremely painful.

My passion/source of main income is videography and photography, which sucks because those can get pretty physical sometimes and if I'm having a spasm, I literally cannot work. I can't even sit at my desk and edit, the pain is that bad. I've been researching disability in my state and I know I would qualify immediately, however, the amount I would receive wouldn't be enough for me to afford my own place comfortably (the area I live in is getting really expensive), and I'm not allowed to have another source of income that's too high, otherwise my disability benefits would be cancelled.

I don't really know what to ask, but I'm just venting because this back pain is so debilitating and friends/family really can't comprehend what it's like, all they can do is watch with concern when spasms happens and I lock up and seize for a while, then start to limp because my muscles are locked. It fucking sucks so bad but I know the surgery was necessary. I have a disability placard for it and when I use it, I get judgmental looks since I'm a presumably healthy late 20's man. It's embarrassing on top of very painful.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/FiveHeadedGiraffe
πŸ“…︎ Jan 27 2022
🚨︎ report
Four years of being severely undertreated with constant trigeminal neuralgia, am 21 and in texas. At my third pain management office and they are treating my pain at about a forth of what it needs to be so I can ease my pain enough to function and sleep. I need direction, this is urgent

I am pretty much bed bound and near death. I am given one 4 mg hydromorphone pill every 6 hours, this is not near enough and I am only seeing relief from this regimen in the morning for about an hour. The rest of the day is spent in agony, I believe I am "pain sick" nauseous, throwing up, high blood pressure.

I have cried to these doctors, and have now typed out 4 letters to this pain doctor and he told me he will never alter my pain medicines yesterday and that this is the most relief I will get in Texas. I have been wanting to die ever sense, I am so tired. I need help. Please, someone tell me what to do before my mental health implodes and I lose my life at such a young age. I cannot do this another four years, I have tried 23 other medications and have had two brain surgeries and the only relief I have had has been from ketamine and hydromorphone, weed and kratom don't work. Yoga, acupuncture and all of that is not keeping me from burning me alive in my mouth. This is extremely urgent, I haven't slept in two days, I am in so much pain I am currently locked in my room researching euthanasia.

This feels like it is in the process of ending badly. My name is Tyler Maddux and I will do anything, I see this as a last cry for help my doctors are just ignoring me. My emotional and physicals pain are too much for me too bare. I don't deserve this, is there anything I can do to get my pain to a constant 6 or 7?

πŸ‘︎ 66
πŸ’¬︎
πŸ‘€︎ u/extasis_T
πŸ“…︎ Oct 20 2021
🚨︎ report
Developer.Salesforce.com: Getting Started with Salesforce Functions Locally. No license required! developer.salesforce.com/…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/SFBlogs_Bot
πŸ“…︎ Nov 23 2021
🚨︎ report
How do I control this ringing? How can I sleep? How can I function life with this constant ring?

I am a 25 year old male who’s been suffering from T for the past year or so. Recently, it’s gotten so loud, and persistent that it’s caused multiple anxiety attacks, sleepless nights, and just down right discomfort. I feel like a β€œcrazy person” who has no idea what β€œsilence” is anymore. Doctors tell me to β€œlearn to live with it” and β€œnot focus on it” but how is that possible? This ringing has taken over my social life, athletic life, and even career. The anxiety it causes me brings me to a level that I’ve never once reached in life previously.

I have impacted wisdom teeth that I am HOPING and PRAYING is the cause for the ringing…but I still want to be prepared if it ISNT after they get removed.

How do you guys navigate life with this? Any remedies besides the obvious background noise and music? I am struggling as I live alone and and work from home. It’s just me and my T.

SOS.

πŸ‘︎ 25
πŸ’¬︎
πŸ“…︎ Nov 28 2021
🚨︎ report
Best way of passing a lot of constants into a function from Matlab workspace? reddit.com/gallery/r6p0o8
πŸ‘︎ 13
πŸ’¬︎
πŸ‘€︎ u/brute313
πŸ“…︎ Dec 01 2021
🚨︎ report
Is it possible to host Foundry locally and use the Video-Chat function to communicate with the others? And if so, how can I set it up?
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/Nivos952
πŸ“…︎ Aug 29 2021
🚨︎ report
Is there such a thing as a locally predictable function which are chaotic over a large scale?

Is there such a function that if you know f(x=1), you could compute the instantaneous derivative at x=1, and then use this to calculate nearby values, but if you wanted to calculate values sufficiently far away, there would be no correlation between the value of the function at x=1 and the sufficiently distant x. That is, outside of a certain delta x, the function behaves similarly to a cryptographic hash function. This would likely be a smooth transition.

All examples of chaos I have read investigate how small changes in initial conditions amplify over many timesteps. After a sufficiently small number of timesteps, two sufficiently similar initial states S and S' can be related by some transformation. As additional timesteps occur, the transformation loses accuracy until it is no better than a guess. I suspect that a similar phenomenon exists for deviations in input to a function, but I have no idea what the functional form would be.

To avoid being too cryptic: I have extremely rich multimodal synesthesia, and I am looking for some sort of mathematical description of it. If I was listening to a song, and I increased the bass, for example, I could imagine how that would change the shapes/colors/textures that I perceive. The song would get a lot wider and most of the non-base components would shrink and push towards the center of my vision. Now, as more attributes of the song change, I quickly lose the ability to predict what the song will look like afterwards. With sufficiently many changes, I have no predictive ability; I must just listen to the music. And the features that I assign to songs have no long range meaning. For example, if I recall listening to a song that has glittering white rectangles spinning and falling down in the center, I can't reason anything about the actual music. I can't guess the genre, the gender of the singer, what musical instrument is making those shapes, etc.

Thank you very much in advance!

πŸ‘︎ 35
πŸ’¬︎
πŸ“…︎ Jul 18 2021
🚨︎ report
Does the constant term of a polynomial function graph ALWAYS only change the vertical position of the graph?

[HIGHSCHOOL MATH] Maybe it's obvious for some of you, idk I just wanted to make sure. I was learning about the vertex form of a parabola graph and noticed the x-less terms always change the vertical position of the graph. Same went for linear function graphs. So I wanted to ask does this apply to higher degree polynomial graphs too?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/lifent
πŸ“…︎ Jan 08 2022
🚨︎ report
Bring Rust and C++-inspired zero-cost abstractions into the lawless world of dynamically-typed Python by enforcing type safety at the granular level of functions and methods against type hints standardized by the Python community in O(1) non-amortized worst-case time with negligible constant factors github.com/beartype/beart…
πŸ‘︎ 68
πŸ’¬︎
πŸ‘€︎ u/muntoo
πŸ“…︎ Oct 22 2021
🚨︎ report
Setting an equation equal to 0 by subtracting a constant means you can replace that 0 w/ function notation g(x, y)?

I'm refershing some math knowledge in prep for grad school.

The material I'm studying is showing the following constraing equation:

  • 2y - 4x = 24.

  • It then says "We need to set the constraint equation equal to 0 so that we can get it into the same form as our function, setting it equal to g(x,y)"

  • It then shows the following:

    • 2y - 4 x - 24 = 0
    • g(x,y) = 2y - 4x - 24

My question is, why does subtracting a constant from 1 side of an equation and setting it = 0 turn that 0 into a function g(x, y)? I guess why does that 0 become g(x,y)?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/GhostGlacier
πŸ“…︎ Nov 20 2021
🚨︎ report
How to set water timer? I use the constant function and turn it off after half an hour but sometimes forget. How do I set the timer to come on for half an hour every day?
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/asheroo92
πŸ“…︎ Nov 13 2021
🚨︎ report
What makes a set of constants the Fourier spectrum of a Boolean function?

Hi, I'm new to theoretical computer science and I'm just learning the Fourier analysis of Boolean functions. My question is this - from the Fourier Expansion theorem we know given a function from n Boolean variables to R, we can find a unique set of coefficients that forms its Fourier spectrum. But is the converse true? Is there any sufficient condition for a given set of constants to be the Fourier spectrum of a function on Boolean variables? I know Parseval's theorem imposes one such condition when the range is Β± 1 although it is far from being sufficient.

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/halfmoonmilkshake
πŸ“…︎ Dec 02 2021
🚨︎ report
Best dry eye treatment for severe cases? My eyes are in constant severe pain to the point that it impairs my ability to function
πŸ‘︎ 7
πŸ’¬︎
πŸ“…︎ Sep 23 2021
🚨︎ report
Initializing variables/constants in functions & loops

I am a Swift noob, and I'm going through 100 Days of Swift now. One challenge required me create an integer square root function from scratch. I've completed the challenge, but I was stuck on one error for a while, and after finally stumbling on the solution, I still don't get it. Here's my function:

func mySqrt(_ n: Int) throws -&gt; Int {
    if n &lt; 1 || n &gt; 10_000 {
        throw sqrtError.OOB
    } else if n &lt; 0 {
        throw sqrtError.noRoot
    } else {
        
        var result : Int = 0    // adding "= 0" fixed the error
        
        for i in 1...100 {
            if i * i == n {
                result = i
                break
            } else if i * i &gt; n {
                result = i - 1
                break
            } else {
                continue
            }
        }

        return result

    }
}

My question is about the result variable. Originally I had it just say var result : Int , but I kept getting a "Variable 'result' used before being initialized" error. Earlier in this course I was taught that it's possible to announce constants and variables as a data type with no actual value until it gets assigned later. Is this not the case in functions, or does it work differently in loops?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Earthquake14
πŸ“…︎ Nov 15 2021
🚨︎ report
Constant disconnects when playing online locally

I am trying to play with my gf on the same connection but every time we try to join one another's server we have a variety of issues before the guest gets disconnected after about 30 seconds. The entire time we're connected the guest has a PC icon with an ethernet port and a red X blinking in the top left. Issues we have when connected: terrain completely different for guest, invisible enemies/players, invincible enemies, frozen enemies, significant lag. Anyone else having theses issues or know a fix? We both love this game and are currently sitting in the same room playing it separately. Is this due to us being on the same IP?

EDIT: Problem has been solved, it was Asus Gamefirst causing my issues, everything is working great since disabling. Skol!

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/camceivable
πŸ“…︎ Feb 04 2021
🚨︎ report
Can somebody please tell me where I can find the definition of the function psi and constant gamma in equation 13.5.9 in "Handbook of Mathematical Functions" by Abramowitz and Stegun?

In my edition, confluent hypergeometric function is in Chapter 13. It is the formula for confluent hypergeometric function of the second kind, U(a,b,z) , where b=1 and z extremely small (close to zero). I couldn't find where the function osi and constant gamma are defined in the book.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/whatisa_sky
πŸ“…︎ Nov 14 2021
🚨︎ report
Fun with trig functions that add to constants

Ok, so we all got sin^2 (x) + cos^2 (x) = 1, but recently i came across another one: sin^2 (x) + sin^2 (x + 2 * pi/3) + sin^2 (x + 2 * 2pi/3) = 3/2. I was able to verify this using power reducing and angle sum trig identities. Check it out here (sorry for the hand writing).

so, i'm pretty sure this generalizes to sum_{n = 0}^{m-1} sin(x + n*2pi/m) = m/2. I've verified for:

  • m = 3 (see link above)

  • m = 4 (see sin^2 + cos^2 = 1)

  • m = 5 (typed it into google, got a line at 2.5)

Any idea how to prove it? usually you can get these types of sums with induction, but it seems like a nightmare for this one. Maybe induction, and use the exponential representation for sin(x)?

also, is this a known thing? I tried googling but didn't come up with great results. Probably used bad search terms.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/TubesNStuff
πŸ“…︎ Nov 03 2021
🚨︎ report
You know it's bad when someone's heart rate is a constant function
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/JustLeafy2003
πŸ“…︎ Oct 13 2021
🚨︎ report
I think I have some type of strange neurological function in which I'm in a constant state of bliss and ecstasy, anyone know of anything like this?

I'm a 28 year old male and since I was 17 I have been in a constant state of bliss and ecstacy 24/7. One day when I was 17 I woke up and just felt this bliss is my mid to lower spinal area. Over time it began increasing and getting more intense over the years. Now I feel it throughout my whole spine and brain but none in my arms or legs. I have some control over it but for the most part it seems to fluctuate in intensity on it's own.

I have not been sad or fallen into depression since it began. I also may be experiencing some type of anhedonia because things I used to enjoy just don't bring me as much pleasure. It seems nothing brings me greater pleasure than what I'm feeling. Also at times if I'm still for long enough the ecstacy will become so intense it's difficult for me to move. I don't take any supplements or medication.

Wondering if anyone knows of anything. Another user in ask reddit proposed it could be serotonin related and I'm wondering if an antagonist could help calm it. Any thoughts?

πŸ‘︎ 37
πŸ’¬︎
πŸ‘€︎ u/Spinalblissontap
πŸ“…︎ Aug 03 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.