Categories
Mastering Development

Split dataframe with all values in one row

I got the following dataframe which is created dynamically but saves all the relevant values into one row: df +—————-+—————-+—————-+—————-+ | 1 | 2 | 3 | 4 | +—————-+—————-+—————-+—————-+ | a1, b1, c1, d1 | a2, b2, c2, d2 | a3, b3, c3, d3 | a4, b4, c4, d4 | +—————-+—————-+—————-+—————-+ I need to […]

Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
User Help

iptables / nftables: Forward UDP data to multiple targets

I need to create iptables rules for the following scenario: Different hosts send UDP data to host A. The target port is 1234. Host A (8.2.3.4) redirects the received UDP data to hosts B1 (7.2.3.1), B2 (22.93.12.3), … Bn (12.42.1.3); the IP addresses are just for illustrations there. It is not about load balancing, so […]

Categories
Mastering Development

Filter dataframe by logic

I have this dataframe: MAT MAT_IN SER D8 0 X A1 Yes – 1 X A2 No X 2 X A3 No X 3 X A4 Yes X 4 Y B1 No – 5 Y B2 No – 6 Y B3 No – 7 Y B4 No – 8 Y B5 No – Where I […]

Categories
Mastering Development

How to prettify JSON.stringify() partially?

Users can download JSON files from our application, which I want to prettify for easier debugging than if all is in one line. However this increases the file size by nearly 40% even if the indentation is just a single tab or space. As a compromise, I want to exclude all values with e.g. the […]

Categories
Mastering Development

How can i filter time frequency in Elastic search?

Consider the following situation, I have two menu- Burger and Pizza which are available as follows- item | Week day |startTime(UTC)| end Time(UTC) —————————————- Burger | Sunday | 8:00 | 11:00 Burger | Monday | 7:00 | 11:00 Burger | Tuesday | 7:00 | 11:00 Pizza | Sunday | 8:00 | 11:00 Pizza | Monday […]

Categories
CMS Mastering Development

Create a New Entry with Fields Populated from an Existing Entry Table

I am still learning how to work with craft on the back end but so far I can see it is a very powerful platform! I was wondering if there is a way that within an existing entry channel say "foo" I have an entry comprised of a table made up of multiple numerical values […]

Categories
Mastering Development

How to divide an array into a tree of buckets sized by powers of two?

How do you take a number representing a list of items, and divide it into chunks, where the number of chunks is a power-of-two, AND where each chunk also has a power-of-two number of items (where size goes up to a max power of two, so 1, 2, 4, 8, 16, 32, 32 being the […]

Categories
Mastering Development

Can I create a SQL database schema where instead of having primary keys, I create new tables for each scenario ? What are its disadvantages?

For example – If I need 3 tables for my app – A,B and C. When creating a new scenario/record instead of inserting a new row, I create a set of 3 new tables – A2,B2,C2 Next time when I create a new scenario, I create set of 3 new tables A3,B3,C3 and so on. […]

Categories
User Help Web Apps

Google Sheets look for string in area

I have in my sheet a list of names in every second line (A2, B2, C2, D2, A4, B4, C4, D4, A6, and so on) and those names can appear in 1 of 4 areas(e.g. H3:I13 or K3:L13) in the same sheet. Now I want to change the background color of the names in the […]