how to merge two lists based on common key value in python

I am trying to get some data from remote server based on fields provided in HTTP/POST request. There are some 1500 fields, however at any given time I can query only 30 fields. So I am breaking the 1500 fields in 50 chucks and making 50 requests to remote host. Return data contains 5000 json records for each 30 fields. I want to merge results from all 50 requests and load final data in MongoDB. I developed following code, is there a better or efficient solution?

import requests
import json
import time 
current_time = datetime.datetime.utcnow()

#certain code ommited 
main_data_list=()
i=0
n=30
# there are about 1500 data fields, separated by 30 chuncks
for r in data_field_chuncks:
    rr = '"name" , '+', '.join('"{0}"'.format(w) for w in r)
    ##print (rr)       
    query_data = rr
    keys = json.loads(query_data)
    response = requests.post('remote_host', headers=headers, data=query_data)
    response_data = json.loads(response.text)
    
    
    for r in response_data('data'):
        # there are about 5000 different names
       
        fieldvalues = (r('d')(0:len(keys('columns'))))
        json_lines = {}
        for n, v in zip(keys('columns'), fieldvalues):
            json_lines(n.replace(".","_").replace("|","__").replace("(","_").replace(")","_")) = v   
        if i==0:
            json_lines("t") = current_time
            #print (json_lines)
            main_data_list.append(json_lines)            
        else:
            for sub_list in main_data_list:
                #each time there will be 5000 look ups
                if sub_list('name')==json_lines('name'):
                    sub_list.update(json_lines)
            
    i=i+1
    time.sleep(1)

for line in main_data_list:
    mongo_database.insert_one(line)

photoshop – Why do my colours completely fade when I merge layers or export to jpeg?

I’ve been working on a colourful image but when I export it to jpeg, the colours are almost gone. Sure, I understand saving in jpeg can lead to change in colour but.. this is the most massive loss of saturation I’ve seen. The same thing happens if I merge down as well.

This is what my layers look like

enter image description here

Am I missing something obvious?

The difference:

enter image description here

The purple colour especially seems to not appear. I feel like I’m missing something obvious. Am i working in the wrong colour space?

How can I get the colours to pop in my export files?

App Windows – PdfMachine merge Ultimate 2.0.7628.22725

File size: 13.9 MB

pdfMachine merge is a fairly simple piece of software that aims to help you with sending large numbers of emails with personalized PDF attachments using Word, PowerPoint, Excel and even HTML files as the base meg templates.​

Its basic principle is quite easy to understand, as it helps you personalize each email with its own distinct information. This makes it ideal for users who need to send batch emails to their subscribers and, for example, need to input their names in each one.

Requires you to install pdfMachine before it can work

First things first, before you can actually take advantage of what this utility can bring to the table, you need to make sure that pdfMachine is installed on your computer. Only after this, the app displays its well-designed main window.

You can customize the meg profile, send emails, search for information within the app and view a detailed list of actions by exploring the log. While at first it might seem a bit complicated, pdfMachine merge’s interface does a good job at keeping things to a minimum level of difficulty.

User-friendly application with a somewhat lean learning curve

The process of creating and managing merge profiles is quite straightforward. Think of it this way: you have your base Word or Excel document, you load it into pdfMachine merge and it automatically generates personalized PDF attachments. Based on your further settings and input, they can be sent via email right away, for any number of recipients.

More precisely, after you load the base file, you need to select the emailing method and then customize the email sending settings. Besides this, you are required to also choose a location for each PDF attachment dynamically generated from meg the template file and the data source file.

When it comes to the actual email sending part, things are even simpler, as you once again have to choose the merge profile, select the email sending method and select one of the displayed merge modes.

You have the option to generate all documents and attachments without actually sending the email, send the message to a specific email address (for example, your own, to make sure they are correct) or send the email to recipients in the data source file directly.

DOWNLOAD
nitroflare

homework – Build using merge sort the ordered string of bytes that contain all characters from s1 and s2

Being given two alphabetical ordered strings of characters, s1 and s2, build using merge sort the ordered string of bytes that contain all characters from s1 and s2.

I have issues with adding the last element in some cases.

bits 32

global start        

extern exit         
import exit msvcrt.dll
segment data use32 class=data
    ; ...
    s1 db 'acdefgwxyz' ; first string in alphabetical order
    len_s1 equ ($ - s1) ; length of first string
    s2 db 'bcdfhij' ; second string in alphabetical order
    len_s2 equ ($ - s2) ; length of second string
    rez times len_s1 + len_s2 db 0
    str_reminder dd 0

segment code use32 class=code
    start:
        cld ; set direction flag to 0 to go from left to right
        mov ESI, s1 ; s1 in source
        mov EDI, s2 ; s2 in destination
       
        mov ECX, len_s1 + len_s2 ; the max length (len_s1 + len_s2)
        mov EBX, 0 ; for s2, how many elements we went through
        mov EAX, 0 ; for s1, how many elements we went through
        mov EDX, 0 ; for the result string
        
        repeta:
            cmpsb ; comparing the elements of the two strings
            
            jng smaller_s1 ; s1(pos) < s2(pos)
            jg larger_s1 ; s1(pos) > s2(pos)
            je equals; s1(pos) = s2(pos)
            
            smaller_s1:
                dec ESI ; decrementing ESI
                dec EDI ; decrementing EDI
                mov (str_reminder), EAX ; save the value of EAX
                lodsb ; put current value from esi in al
                mov (rez + EDX), AL ; put in result on position edx the value from al
                mov EAX, (str_reminder)
                inc EDX ; incrementing EDX
                inc EAX ; incrementing EAX
                cmp EAX, len_s1 ; if we are done with elements from s1
                jge sf_prg ; jump to sf_prog
                loop repeta ; repeating the loop
                jecxz sf_prg ; if ecx = 00000000, we jump to sf_prog
            
            larger_s1:
                dec EDI
                dec ESI
                mov (str_reminder), EAX
                mov AL, (EDI)
                mov (rez + EDX), AL
                mov EAX, (str_reminder)
                inc EDI
                inc EDX
                inc EBX
                cmp EBX, len_s2
                jge sf_prg
                loop repeta
                jecxz sf_prg
            
            equals:
                dec ESI
                mov (str_reminder), EAX
                lodsb
                mov (rez + EDX), AL
                mov EAX, (str_reminder)
                inc EDX
                inc EBX
                cmp EBX, len_s2
                jge sf_prg
                inc EAX
                cmp EAX, len_s1
                jge sf_prg
                loop repeta
                jecxz sf_prg
        sf_prg:
        
        cmp EAX, len_s1 ; comparing EAX with the length of s1, if EAX = len_s1 then we are done with the terms of s1 
        je ebx_bigger; if we have to add terms from s2
        jne ebx_smaller ; if EAX is not equal to len_s1 we are done with the terms of s2
        
        ebx_bigger: ; the remaining terms of s1
            mov ECX, len_s2
            sbb ECX, EBX
            repeat_:
                mov AL, (EDI)
                mov (rez + EDX), AL
                inc EDX
                inc EDI
            loop repeat_
            jmp end_prg
        
        ebx_smaller:
            mov ECX, len_s1
            sbb ECX, EAX
            repeat__:
                lodsb
                mov (rez + EDX), AL
                inc EDX
            loop repeat__
        
        
        end_prg:
        push    dword 0      
        call    (exit)      
```

plsql – Rewrite existing procedure without merge as Oracle 12.1 doesn’t support it

I have a procedure where data is pushed into table using merge logic used as part of it.
The procedure takes string passed at runtime and splits it into rows.

I need to change the merge part using any other method other than merge, maybe cursor for loop as Oracle 12.1 does not support merge and similar take input string and insert/update accordingly in the destination table.
inside procedure and we cannot get it upgraded due to constraints.

So everything in proc would be same just that it would be without merge.

The details are inside the fiddle with table and sample data.

https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=34a88972aa53cf60b1199f9f277285f4

views – How can I count and merge rows with the same date?

I’ve created a view. To keep it simple let’s call it: User score. A user can flag a node, if the node is flagged the score should be + 1.

Node ID 1, flagged on 08-11-2020
Node ID 2, flagged on 08-11-2020
Node ID 3, flagged on 08-11-2020
Node ID 4, flagged on 10-11-2020

The default output in the view is this. What it should be is:

User created a flag on 08-11-2020 (3)
User created a flag on 10-11-2020 (1)

It should merge all the same dates and count the rows, so I know on which date a user scores the best. On Google I found the option: Aggregation but it seems like it doesn’t work on the date field in my view?

How do I bring back my lost space after trying to merge APFS partitions?

How can I merge primary APFS partition with other empty APFS partition?

After reading and following the above, I got stuck on the eraseVolume "Free Space" and now that space seems irrevocably lost. Did apfs resizeContainer but got Error: -69743: The new size must be different than the existing size and it seems that my 2TB physical drive can recognise only 999.4GB…
enter image description here

any help?

version control – How do I create a merge request for a project?

I’d like to create a merge request for a project. I found a page on drupal.org titled Issue forks & merge requests which seems to address this but I’m not really getting anywhere. The page says:

On an issue page, make sure the fork is created and you have access.

  1. If the fork has not been created yet, click “Fork {project}”
  2. If you do not have push access yet, click “Get push access”
  3. If you see “✓ You have push access,” you’re all set!

The only place I could find a “Fork” button was on https://git.drupalcode.org/project/project_name/-/forks. But when I click on that I see just see a namespace with my name, and a greyed out “select” button, which, if I hover over it, displays “You have reached your project limit”. But I think I’m in the wrong place anyway.

The instructions start with “…on the issue page” so I created an issue on drupal.org for the project, on the issue page there are no links that mention “fork” anywhere to be seen.

What am I doing wrong?

Develop a simple serious game to dedramatize git merge conflict

I’m creating a course on GIT for non computer scientist.
As you know, developper already fear merge conflict (Do developers fear merge conflicts?), so that even worse for non computer scientist (ex in Humanity…)

So, i decide to take some time to think/build a scenario to de-dramatize this common problem, by creating a serious game.

After many hours to search on boardgamegeek website, i’m convainced that there already exist some game/mechanisms on abstract boardgame that adapt well to merge conflict.

The game need to be played using a board game representend as a text/Ascii file. This text file / Ascii file is synchronized with all users, and all users have a local copy of this file on their computer. Each users could change the text file at any time and push/sync the modified file/board on the server. Each push from users to the server generate a new state for the boardgame. There is no problems until two user change the same line on the board …

My Objective was to generate “git merge conflict” and “conflict resolution” when multiple players try to compete for one shared resource.

My actual finding (26/10/2020) :

  • I found that “Pent a rush” or “5er-finden” (see “https://boardgamegeek.com/boardgame/285535/5er-finden” was interesting because there is one board with pattern shared for all users, and all users have limited time to report their finding on the local board to win the step.

So if someone find a pattern and report it before you and before the end of time for this step, you need to resolve a conflict by accepting the other player answer.

Real time playing, with auction/bidding mechanism. Players acquire ownership of sections of city blocks then place tiles, representing businesses, onto the shared block-sections. So there is competition between users.

If you already think or develop something related to de-dramatize git merge-conflict, or if you have a game with some of these caracteristic in mind, i’m interested to share expertise here as community post.

Ps : I also cross post and open discussion here :
https://boardgamegeek.com/thread/2527651/adapt-board-game-mecanism-serious-game-learn-git-c