Categories
Development

Finding max values from given subarrays using numpy’s strides

I’m given such 2D-array. My task is to find max values in subarrays painted by different colours. I have to use strides and as_strided. So far my code looked like this: a=np.vstack(([0,1,2,3,4,5],[6,7,8,9,10,11],[12,13,14,15,16,17],[18,19,20,21,22,23])) print(np.max(np.lib.stride_tricks.as_strided(a,(2,3),strides=(24,4)))) It properly shows the maximum value of the first block, which is 8, but i have no idea how can i move […]

Categories
Development

Excel formula , negate records based on date and type and retrieve unique rows

I have an excelsheet with several rows and columns of data , important columns being Company Name, Date of Transaction , Type of Transaction , Transaction amount. Type of Transacation can be deposit or withdrawal. Now I want to negate(delete) all those rows of records where the deposit and withdrawal are same amount on the […]

Categories
Development

Is the code for sorting a std::vector

I wrote a code that sorts vector strings by length. Unfortunately, I’m not sure whether it will work in the next standard in this form. Is this the correct code in C++20? #include <algorithm> #include <iostream> #include <string> #include <ranges> #include <vector> int main() { std::vector<std::string> words = {“std”, “vector”, “string”, “optional”, “clamp”}; // C++11 […]

Categories
Development

o.s.b.CachedIntrospectionResults – Not strongly caching class because it is not cache-safe

Does anyone know what does this warning mean? o.s.b.CachedIntrospectionResults – Not strongly caching class because it is not cache-safe It is a warning logged in my play framework application. It seems has something to do with this class from spring but I can’t find more info…

Categories
Development

React Native + Redux: why an old state is retrieved from the store?

I got stucked on this for a past few days and have no idea what I am doing wrong. For purpose of this question I created a simple calculator that multiplies a number from user by 2. We have a simple pure reducer which is just a key-value store (not the best storage structure but […]

Categories
Development

Angular HttpClientModule undefined

I can’t get the HttpClientModule, the following error appears while loading this ModuleType. I get this error in the registerNgModuleType method from Angular. function registerNgModuleType(ngModuleType) { if (ngModuleType.ɵmod.id !== null) { /** @type {?} */ const id = ngModuleType.ɵmod.id; /** @type {?} */ const existing = (/** @type {?} */ (modules.get(id))); assertSameOrNotExisting(id, existing, ngModuleType); modules.set(id, […]

Categories
Development

Is using Durable entities a good way to store result of the workflow?

I want my orchestrator function to return an object representing what happened in my workflow, basically some stats about what my workflow has done: users retrieved from an API, users inserted in a database, … What I was doing until now was to return these information from my activies functions and aggregating them in my […]

Categories
Development

Nested decode in where clause

I have a cursor that fetches address for the id passed, based on the latest activity date. CURSOR get_address_upd_c ( id t1.id%TYPE ) IS SELECT street_line1, street_line2, city, stat_code, zip, activity_date, atyp_code FROM addr WHERE addr_im = ‘1’ AND status_ind IS NULL AND from_date < SYSDATE AND DECODE (TO_DATE, NULL, SYSDATE, TO_DATE) >= SYSDATE ORDER […]

Categories
Development User Help

How to create multiple txt files with incrementing numbers and writing in them using batch files (.bat)

I want to create multiple txt files with incrementing numbers with batch; here’s my example @echo off for /l %i in (1,1,13) do @echo bla bla bla > “%i.txt” @echo bla bla blo > “%i.txt” @echo bli bli bla > “%i.txt” @echo blom blom blom > “%i.txt” Help me, please.

Categories
Development

How can I read github and convert csv into json?

sorry for this generic question with no code. I’m asking how can I read the csv at github here and convert it to json to be able to read it in my application. I’d need a dynamic way to keep reading the new updated csv and have them as json. Not sure how to connect […]