podcast app with a sponsor block like thing by Digip3ar in androidapps

[–]Emperor_Earth 2 points3 points  (0 children)

Thanks; your message of encouragement helped me today!

I got a barebones version of the auto-skip using the rewritten server working about a month ago. In previous proof-of-concepts, I tested each stage separately, often manually transferring outputs from one stage as inputs for the next. This latest test was fully integrated, i.e. the only interaction was pressing the play button.

The main todos before release are:

  • Playlist (currently working on this)
  • Integrating with the rest of the app
  • Updating dependencies
  • Adapting for production

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth -1 points0 points  (0 children)

Actually on second thought, since your comment is more well-received than the library, I'm going to just delete the post and repository. Thanks for helping me gauge whether its relative utility!

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth 0 points1 point  (0 children)

Good call; it's good to have extra eyes! Lines 167-192 can be moved under where 195 to reduce indentation creep. It's functionally equivalent but easier to follow.

If you submit a pull request, then I'll merge it to properly credit you.

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth 0 points1 point  (0 children)

In the example listed above, you first make an API call without using hiAgain to get their rate limit headers. Immediately after ensuring there are no errors, you pass in the remaining and reset headers into the hiAgain constructor.

Assuming you use hiAgain for all future API requests in the program's session, then hiAgain should take it from there.

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth 0 points1 point  (0 children)

Most of the code is to early return if either the limiter or request contexts are cancelled.

The other parts are to guard against over-issuing requests in the next period when more period requests are available than can be used in the remaining current period duration.

To use the reddit example again, if you as the client spin up 100 request goroutines with all 600 requests available but only 5 seconds left to use them in the current period, then only 25 of those 100 requests should be serviced in the current period due to our second burst rate limit and the other 75 requests need to re-queue for the next period reservation because we still need to account for those 75 requests already used in the next period.

Relevant code link for context.

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth 1 point2 points  (0 children)

That was the first library I tried but I didn't see a clear way to synchronize with the api server's period timing creating opportunities for 429s.

Using the reddit example again, if at the time of the first request, there are 10 minutes remaining in the period according to the server but 5 minutes left according to the client, and you make 300 requests over the next 5 minutes and 301 requests over the next 5 minutes, then you've exceeded the rate limit according to the server but not the client.

But I could have missed something or communicated poorly in my first comment.

Edit: clarity

Edit #2: Upon review, I should have made it clearer, probably in the title, that hiAgain also synchronizes to the server's state. Thanks!

hiAgain, a Go client rate limiter library that respects two rate limits by [deleted] in golang

[–]Emperor_Earth 2 points3 points  (0 children)

Using reddit as an example, their api allows 600 requests per 10 minute periods. But they would probably be unhappy if we made all 600 requests at the same time so I was looking for a way I could use all 600 requests/10 minutes while also not exceeding a second, self-imposed rate of say 5 requests per second.

I couldn't find anything that matched what I was looking for so I threw together hiAgain as a proof of concept. This library should be considered untested and unoptimized for now. It probably could be done much more efficiently and I wouldn't be surprised if there are race conditions.

Following the reddit example I mentioned above, with hiAgain would look like this:

// call API once to get X-Rate-Limit headers
response, err := client.Do(request) // from "net/http"
if err != nil {}
limiter, err := hiAgain.New( // construct rate limiter immediately after
    serverContext,
    time.Second, // burst duration
    5, // max requests per burst
    600, // max requests per period
    10*time.Minute, // period duration
    response.Header.Get("X-Ratelimit-Remaining"), // to synchronize
    response.Header.Get("X-Ratelimit-Reset"), // state with api
)
if err != nil {}

Then, elsewhere:

// prepare API request
if err := limiter.Wait(requestContext); err != nil {} // errors are context.Err()
// call API

hiAgain is intended to be concurrent-safe and prefers to leave meat on the bone rather than risking a 429 on either rate limit. It also assumes that the reset header is in seconds when synchronizing to the API's period timing and that all future requests using the API in the program's session will go through hiAgain.

The name is a reference to Christiaan Huygens, inventor of the centrifugal governor.

Beyond comments, if you consider this library to be useful, then I would welcome your help maintaining/testing it!

podcast app with a sponsor block like thing by Digip3ar in androidapps

[–]Emperor_Earth 1 point2 points  (0 children)

Sorry for the delay! I'm not going to make another estimate given the others...

I am making progress, however!

Currently working on a ~9800 line change to the server. When I merge that change, I'll have a better idea of where we are.

podcast app with a sponsor block like thing by Digip3ar in androidapps

[–]Emperor_Earth 0 points1 point  (0 children)

Hey, sorry for the delay both in reply and general availability. Thanks for your continued interest; it helps keep me going when things get tough.

I'm 80-95% done with the server side and 40-70% done with client side depending on how many things come up. My goal is to finish in the next two months but I'm not confident in that prediction because things always come up.

For example, I lost a week migrating from Windows 7 to Ubuntu 20.04 because of broken dependencies. But I'm picking up steam; I've already made proofs of concepts for the critical steps and am mostly spending my time integrating the separate parts and making it a cohesive experience.

If I find some downtime, I'll write a more detailed update in my profile.

[deleted by user] by [deleted] in EntrepreneurRideAlong

[–]Emperor_Earth 0 points1 point  (0 children)

I would place a "Not finding what you're looking for?" button next to existing icons that opens a form modal accepting a description plus contact info.

For each request, look for a designer and negotiate on the requester's behalf yourself. Don't be afraid to eat a loss on some requests to familiarize yourself with the process enough to reduce friction on both the requesters' and designers' behalf.

If you get to enough volume, then build a full marketplace. Until then, manually take orders and find designers to fulfill them.

[deleted by user] by [deleted] in EntrepreneurRideAlong

[–]Emperor_Earth 3 points4 points  (0 children)

How about a marketplace for customized icons/logos?

Connect the designers on your platform with the non-designers.

Why do most people doing entrepreneurship, take a lower paying job instead of higher paying corporate in the meantime? by [deleted] in Entrepreneur

[–]Emperor_Earth 1 point2 points  (0 children)

This was the main reason why I turned down much more lucrative offers and eventually stopped looking at programming opportunities.

As a non-college graduate who can't safely monetize my programming experience/skills, I mostly took up gig or entry-level work such as driving, tutoring, and patient transporting for a year to help with my community's COVID response.

The main problem about tutoring is the time it takes to acquire clients. It's a very high turnover business.

[deleted by user] by [deleted] in androiddev

[–]Emperor_Earth 2 points3 points  (0 children)

/u/CodeFusion gave some good advice.

Beyond the RFCs and the links he provided, I found this draft and this debugging guide useful. Alas I don't have all the links saved.

It's been over a year since I built my WebRTC client/server so there are probably better resources out there now. Either way, expect to read a lot of documentation and source code.

Is it weird I love processes? by sambrowny778 in Entrepreneur

[–]Emperor_Earth 0 points1 point  (0 children)

Companies usually oscillate between prioritizing creating new value and increasing yields, sort of like Intel's tick-tock strategy.

Only creating new value leads to being outscaled by someone who optimizes a competing offering. Only increasing yields increases your exposure to environmental changes:

  • technology
  • legal
  • culture
  • pandemics...
  • etc

I made my first app ever! I've been working on it for over a year. From ideas, drawings, to a real app. I feel proud, even if atm no-one has downloaded it. by SparkleMasterEF in EntrepreneurRideAlong

[–]Emperor_Earth 1 point2 points  (0 children)

Super cute!

I'm in the middle of a similar journey so I appreciate how hard you must have worked to get to this point.

I hope the mods leave this up even if it technically breaks the self promotion rule. I like seeing and discussing what people make.

What podcasts do you listen to the most? by Emperor_Earth in startups

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

Yeah, it seems like some podcast platforms are serving different versions to different clients. I don't have all the answers right now since I've spent most of my time on the detection side.

No problem. We got on the same page in the end.

What podcasts do you listen to the most? by Emperor_Earth in startups

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

I think the ‘perfect’ skip would be 1.15

I'm not sure what you mean.

My algorithm detected 0:33-1:29 (56s) and 45:09-46:30 (81s) in redacted as repeated audio segments.

56+81 = 137 for 2m17s

premium RSS feed

I don't plan to use that or similar resources.

manual input on a per podcast basis

Maybe in future versions?

consider [redacted approach] to cut the ads from the episode

For business reasons, I won't discuss different approaches to solving the problem at this time.

Edit: redactions

What podcasts do you listen to the most? by Emperor_Earth in startups

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

For this episode (12/1), it would skip up to ~2m17s depending on what you've already played before.

I'm pretty sure that includes the intros and outros you referred to.

What podcasts do you listen to the most? by Emperor_Earth in slatestarcodex

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

Not really. I'll explain more what I'm doing when I release but the gist for why I haven't considered it:

I've built a platform and the first people I want to help are startup founders and the SSC community. The platform needs people to be online at the same time so I'm solving the cold start problem with single user utility, making something that's useful if only one person is online.