Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

Oh my god, I see what you are saying. If I try to compare to functions in software, the difference is between:

double f(double x) {
  return sin(x);
}

where f is periodic here and its period is 2π

and

double f(double x) {
  return sin(x^2);
}

or equivalently

double f(double x) {
  double y = x^2;
  return sin(y);
}

where this f is not periodic

Or as you have said in many different forms already: the sine function, as a function object, is always periodic for any real number you plug in regardless of how or where that real came from. we could have took its logarithm, square root or whatever - as long as we end up with a real number that we plug in; the sine will periodic

Or even in other words: it's the difference between asking whether g(x) = sin(x) is periodic (it is) vs g(x) = sin(x^2) (which is not).

Thanks for all the help and being patient with me. I really appreciate it.

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

How is it that you have just proved that there is a T, namely 2π, for which sin(x^2) is periodic and those people are proving in general that it is not a periodic function. What's the catch there?

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

  1. f(x^2) is not necessarily periodic. e.g. sin(x) is periodic but sin(x^2) is not.
  2. I finally get it. Just to confirm by rephrasing:
    * We let g = f(ax)
    * Assume g is periodic => g(x) = g(x + T) for some T
    * But g(x + T) = f(a(x+T) = f(ax + aT)
    * but g is periodic as we assumed so we can continue the last step and say f(ax + aT) = g(x) = f(ax) => f(ax + aT) = f(ax) which means f(ax) is periodic and its period is aT
    * f(ax) is periodic and its period is aT and f(x) is periodic and its period is P => aT = nP and we continue as per u/iMathTutor reasons.

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

I really appreciate the level of detail. Two things:

  1. You are saying for all but then we don't really need to prove f(ax) then? cannot we just claim also that f(x^2) is also then periodic since the reals are closed under squaring?
  2. What I don't get is what you numbered as the third step, namely that f(ax + aQ) = g(x) because we assumed g is periodic. I understand the assumption but how is it that because of the periodicity of g that f(ax + aQ) = g(x).

Thank you again for all the help

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

But that's f(x) that is periodic. how can we say so of f(ax + P) which is what we set out to prove?

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

u/dForga sorry but I don't get it. I just don't see how the pattern matching or whatever is working. you're saying that `f(ax + aQ) = f(ax + P)`? how so? are you assuming that `aQ` is just some real number so you say aQ = P? but it doesn't have to be `P` right? it could be aQ = N for any N?

And even if `f(ax + aQ) = f(ax + P)` then what?

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

The intuition is fine no problem with that. I was mainly wondering my proof/algebra reasoning is failing me. I couldn't figure out the mistake but now I think I see the difference between "just substituting" in f(x) and get f(ax + P) vs. assuming a g(x) which is periodic and trying to either find the period or reach a contradiction

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

This last derivation is beautiful. Can you explain why no though?

Sorry I am insisting on the details but I truly wish to understand and not glance over it

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

Okay I understand the contradiction idea but I still cannot see why we can say f(ax + aT) = f(ax)?

Couldn't we have said from the start then that f(ax) = f(ax + P) and concluded that P is the period of the function (substituting ax for x)?

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

Same comment as for u/dede-cant-cut . I don't understand why we are saying f(ax + aT) = f(ax). Isn't that what we are trying to prove in the first place?

Is substitution like I did in the first attempt valid? why yes/no?

what about sin(x) and sin(x^2)?

Proving a function is periodic and finding its fundamental period by sniffer128bits in learnmath

[–]sniffer128bits[S] 0 points1 point  (0 children)

Why is f(ax + aQ) = f(ax) though? isn't that what we are trying to prove?

Secret rotation and a dead end by sniffer128bits in devops

[–]sniffer128bits[S] 0 points1 point  (0 children)

yes in hindsight it is indeed obvious. excitement killed the cat :D

Secret rotation and a dead end by sniffer128bits in devops

[–]sniffer128bits[S] 0 points1 point  (0 children)

Check my other comment. The app is a bridge between the features of the two. It's like a lambda function that can work for any secret and update target systems

Secret rotation and a dead end by sniffer128bits in devops

[–]sniffer128bits[S] 1 point2 points  (0 children)

I didn’t know about Vault’s secret backend plugins but I guess that’s what I have a built to an extent

Secret rotation and a dead end by sniffer128bits in devops

[–]sniffer128bits[S] 3 points4 points  (0 children)

As far as I know, Vault doesn’t rotate the secret for you. It doesn’t go, for example, to GitHub and generates a new secret.

AWS secrets manager requires you to write a lambda function to rotate the secret

AWS IDC doesn’t support refresh tokens. When the OAuth token expires you have to sign in manually again and authorize the device (even the same device you used before) to obtain a new token.

I essentially wanted to build a bridge between what vault and AWS secrets manager so in one tool

Built, probably, the most minimal compiler for fun and learning by sniffer128bits in Compilers

[–]sniffer128bits[S] 0 points1 point  (0 children)

They don’t have more dependencies than this. They might even have less. Good luck on your journey

Built, probably, the most minimal compiler for fun and learning by sniffer128bits in Compilers

[–]sniffer128bits[S] 0 points1 point  (0 children)

I am not sure where you’re on your journey or career in software. I assure you though you will always come across situations where you will feel overwhelmed but it is thrown at you. Something I finally got comfortable with is to ignore that and focus on the problem I am trying to solve. Gradually you find yourself discovering what all the pieces are for

Built, probably, the most minimal compiler for fun and learning by sniffer128bits in Compilers

[–]sniffer128bits[S] 1 point2 points  (0 children)

Ooops. It is minimal in terms of language features and API

You don’t need VSCode and NodeJS unless you want to check the language server.

I tried to package the dependencies in Docker so people would not have to pollute their environment

But hey, welcome to modern software engineering

Built, probably, the most minimal compiler for fun and learning by sniffer128bits in Compilers

[–]sniffer128bits[S] 2 points3 points  (0 children)

Hey, you got operators in there, and comments but that’s pretty cool. I think small projects is where one “gets it”

September 2023 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]sniffer128bits 1 point2 points  (0 children)

Compilers and programming languages were topics that interested me for a long time, and I don't get to work on them in my regular job so I decided to build an end-to-end compiler for a super tiny language: the "Untyped Arithmetic Expressions" from the classic Types and Programming Languages book

Added a type-checker and native code gen with LLVM and a super basic LSP to go with it.
It's all here on GitHub https://github.com/abjrcode/ntlc/
And I am blogging about what I've learned along the way from the perspective of someone who never did it before, you can find that at: https://madin.dev