distributed system – How to share dynamic configuration data in a clustered environment?

I’m working on an side-project which will perform some API requests to a third party service. I’m limited how many requests I can send, so each minute the application is scheduled to get a certain number of entities from the database and make API requets for those entities. The application is designed to work in a clustered environment, so if the limit for how many requets I can send to the third party API is 1000 requets per minute, and I have 4 instances running, each instance should sent only 250 requests per minute.

The part that I’m having problem of finding a good solution for, is about the process of retrieving the entities from the database in a way so I don’t send requests for the same entites by more than 1 instance.

In a case when 4 instances are running, and the database holds 2500 rows of those entities, the first instance will query from 0 to 250, do some work with those entities, and then send requests for them to the third party service, the second instance when triggered by the scheduler, should now pickup from 250 to 500, since the first entities were processed by the first instance already.

The schedulers as you know can be triggered at the same time, so it can be problematic.
I’m using Redis for caching, and one solution that came to mind was to use GETSET of Redis, and save the offset and limit in Redis, since it is single-threaded.

e.g. If the first instance got the entities, it would set offset and limit on Redis to 250:500 (offset:limit), when the second instance is triggered, it would get that value, query the entities in this range, and update it to 500:750.

I’m not sure if this is the correct solution, and if there is something out there that can be more appropriate for this use case.

Note: I know that 1000 requests per minute are nothing, and can be handled perfectly by one node, but this is more of a side-project I’m using for learning mostly.

docker – nginx proxy pass to the parameters defined (dynamic) host and port

On local machine, I have nginx installed, and on docker, I have dynamic ip+port vms can be created at anytime. So how to access them by specifing host and port in url parameters?

eg:

I have dynamic number of jupyter servers in docker container:

http://10.42.0.9:8888

http://10.42.0.10:8888

http://10.42.0.255:8888

What config do I need to access them like:

http://localhost/?rhost=10.42.0.9&rport=8888 -> http://10.42.0.9:8888

http://localhost/?rhost=10.42.0.10&rport=8888 -> http://10.42.0.10:8888

http://localhost/?rhost=10.42.0.255&rport=8888 -> http://10.42.0.255:8888

I have tried something like

enter image description here

But it doesn’t work like I expected.

dynamic programming – Select each item from a sequence of $n$ buckets to maximize value?

You have a sequence of n buckets. Each bucket $B_i$ contains three items, where each item has some value and belongs to some category. Multiple items may belong to the same category. Your job is to select exactly one item from each bucket so that the total value of the selected items is maximized, but such that no two items selected from adjacent buckets belong to the same category.
Design an algorithm to determine which item should be selected from each bucket to maximize the total value. If there is no solution, your algorithm should state this.

magento2 – I create two dynamic field in admin but one of them not working in magento 2?

magento2 – I create two dynamic field in admin but one of them not working in magento 2? – Magento Stack Exchange

Dynamic content with a view and a block

I’m new to Drupal (using Drupal 8) and have been struggling to get content from a block I’ve create to display when accessing the view.

I’ve created a “service” view (page) which lives at the path “/service”. I’ve configured the view to display the desired fields from the “service” content type. The view uses a contextual filter on the title of the “service” content type which allows clean URLs to work “/service/name-of-service”

The above works well. I’m running into problems with an “info” view (block) that I’ve created. The “info” block pulls in different fields from the same “service” content type. I decided to use a block for the remaining fields as it allowed me to place them in a specific block region that works for our desired page layout.

I’ve tried setting up a contextual filter in the block to filter by “ID” and provided a default value of “Content ID from URL”, but I can’t get this to work, no fields display at all. If I flip the setting to “Display all results for the specified field”, fields do display, however, the content of the fields displaying in the “info” block is not pulling from the same node (because there is no contextual filter).

Is there a way I can setup a contextual filter to accomplish this? I’ve been able to use the contextual filter by ID successfully when working with the node itself, but can’t get the same behavior when using views.

google sheets – Calculations based on a dynamic cell

I am recording stats from games. One sheet lists PLAYERS with their stats. It includes a RATINGS formula based on performance standard of previous games.

One a second sheet, I list the results of the games. One cell takes the current rating from PLAYERS/RATING, Then incorporates the current game stats and displays an updated NEW RATING.

This new ratings should be used for the next game …. and so on.

My issue is when the RATING in the PLAYERS sheet is updated it would recalculate all previous games as well, right? How can I work around this?

dynamic programming – Algorithm that counts unique ways of securing doors

I’m having trouble even starting this problem and need help getting the ball rolling.

Here is the question:

You are given a row of n doors, each of which can either be locked or unlocked.
Your goal is to have exactly S secured doors. The issue is that not all locked doors are secure.
A door is secure if and only if:

  1. This door is locked AND
  2. This door is the first door (i.e., the left most door) OR The door to this one’s left is also
    locked

Develop an algorithm that, given the number of doors n and a value S, counts the total
number of unique ways the doors can be locked to achieve EXACTLY S secure doors

I understand that a Dynamic Programming approach should be used but I’m unsure on how to divide the problem into subproblems and what an optimal approach would be. Any thoughts on how to begin?

system.xml – Magento2.3.5 Disabled dynamic row system field

How can one add a disabled attribute to an input field in dynamic row system ref: https://devdocs.magento.com/guides/v2.4/ext-best-practices/tutorials/dynamic-row-system-config.html

What I’ve tried:

$this->addColumn('price', ('label' => __('Price'), 'class' => 'required-entry', 'disabled' => true));

I would think that this would add the attribute disabled with value true. But it doesn’t

Anyone any ideas?

Dynamic media query

In WordPress how can I modify the media query screen size? Say if I have a customizer option for mobile size : 600px and the in CSS this value should change.

For javascript, there is wp_localize and similar functionality for CSS?

Please help

how to run a dynamic flutter web app on google app engine

I need to implement an ecommerce web app with google firestore as backend, I would like to deploy it on google app engine. Until now for simple web app I used python with flask.
I know that python flask is the server side of the app and html/css/js the client side but it is not clear to me for flutter web app how to handle the server side of the app.
Can you give me some clarification?

Thanks.

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123