How do I copy between disks without having to wait to click on the error boxes?

I want to copy from one external hard disk to another. The content to copy is around 1 TB. Is there a way I can do this without sitting in front of the computer? The issue is that there are errors while copying and I have to click on boxes so that the transfer can continue. This prevents me from doing other things and I have to sit in front of the computer. I hope I am clear and you can help me.

Regards.

Edit: Just now, I am using rsync to copy the disks.

rsync -av '/media/kartikeys/My Passport/' '/media/kartikeys/MONK/My Passport/' 

Earlier, I was copying and pasting as I usually do. The errors I’d get were about Duplicate Files, and about some file not being found. I would come back to the computer to find that unless I click the ‘skip’ button, for example, the copying stops.

Merge the Bounding boxes near by into one

I am new in python and I am using Quickstart: Extract printed text (OCR) using the REST API and Python in Computer Vision for text detection in Sales Fliers.So this algorithm is given has a coordinates Ymin, XMax, Ymin, and Xmax and draw a bounding boxes for each line of text, it show in this next image.

enter image description here

but I want to group the texts that are close by to have a single delimited frame. so for the case of the above image it will have 2 bounding boxes containing the closest text.

The below code provide as a coordinates Ymin, XMax, Ymin, and Xmax and draw a bounding boxes for each line of text.

import requests # If you are using a Jupyter notebook, uncomment the following line. %matplotlib inline import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from PIL import Image from io import BytesIO  # Replace <Subscription Key> with your valid subscription key. subscription_key = "f244aa59ad4f4c05be907b4e78b7c6da" assert subscription_key  vision_base_url = "https://westcentralus.api.cognitive.microsoft.com/vision/v2.0/"  ocr_url = vision_base_url + "ocr"  # Set image_url to the URL of an image that you want to analyze. image_url = "https://cdn-ayb.akinon.net/cms/2019/04/04/e494dce0-1e80-47eb-96c9-448960a71260.jpg"  headers = {'Ocp-Apim-Subscription-Key': subscription_key} params  = {'language': 'unk', 'detectOrientation': 'true'} data    = {'url': image_url} response = requests.post(ocr_url, headers=headers, params=params, json=data) response.raise_for_status()  analysis = response.json()  # Extract the word bounding boxes and text. line_infos = [region["lines"] for region in analysis["regions"]] word_infos = [] for line in line_infos:     for word_metadata in line:         for word_info in word_metadata["words"]:             word_infos.append(word_info) word_infos  # Display the image and overlay it with the extracted text. plt.figure(figsize=(100, 20)) image = Image.open(BytesIO(requests.get(image_url).content)) ax = plt.imshow(image) texts_boxes = [] texts = [] for word in word_infos:     bbox = [int(num) for num in word["boundingBox"].split(",")]     text = word["text"]     origin = (bbox[0], bbox[1])     patch  = Rectangle(origin, bbox[2], bbox[3], fill=False, linewidth=3, color='r')     ax.axes.add_patch(patch)     plt.text(origin[0], origin[1], text, fontsize=2, weight="bold", va="top") #     print(bbox)     new_box = [bbox[1], bbox[0], bbox[1]+bbox[3], bbox[0]+bbox[2]]     texts_boxes.append(new_box)     texts.append(text) #     print(text) plt.axis("off") texts_boxes = np.array(texts_boxes) texts_boxes 

Output bounding boxes

array([[  68,   82,  138,  321],        [ 202,   81,  252,  327],        [ 261,   81,  308,  327],        [ 364,  112,  389,  182],        [ 362,  192,  389,  305],        [ 404,   98,  421,  317],        [  92,  421,  146,  725],        [  80,  738,  134, 1060],        [ 209,  399,  227,  456],        [ 233,  399,  250,  444],        [ 257,  400,  279,  471],        [ 281,  399,  298,  440],        [ 286,  446,  303,  458],        [ 353,  394,  366,  429]] 

But I want to merge then by close distances.

Network flow for assigning books to boxes

I am trying to model the following problem correctly as a min-cut network flow problem. I have $ n$ books and 2 boxes. I also have books that I know must go in one of the two boxes. In addition, each book has a certain profit if I put it in the same box with another book. So for instance, if I pair book $ i$ with book $ j$ I might have a profit of 10 dollars so long as they’re in the same box. If I have 3 books in one box, I’d have to sum the profit of 1 and 2, 2 and 3, and 1 and 3. I want to find the best way to assign the not-yet assigned books to either box 1 or 2 to maximize my profit. Formally:

  • 2 boxes: $ b_1$ and $ b_2$
  • Set: $ N$ of $ 1…n$ books
  • $ S_1$ = set of all books that must go to box 1
  • $ S_2$ = set of all books that must go to box 2
  • $ p_{ij}$ = The profit by having books $ i$ and $ j$ in the same box
  • Objective (roughly): $ max(\sum_{i=1}^{2}\sum p_{ij})$ (maximize the profit over all boxes)

My ideas so far:

  • Formulate the problem as a min-cut problem because we are trying to end up with two sets of books (one for box 1, one for box 2). Would it be correct to say that $ -min(-\sum_{1}^{2}\sum p_{ij})$ is equivalent to our maximization above? I tried simplifying it further but I’m not sure how.

    • Make source node for box 1, node for each book not assigned (not in $ S_1$ and not in $ S_2$ ) and a sink node for box 2.

My question:

With the previous formulation in mind, I’m confused on what the edges would be like. I have edges from box 1 to the book nodes and then the book nodes to box 2 but I’m not sure if this makes sense, largely because I need to make sure my summation notation is correct and how to turn that into an appropriate graph. Could anyone offer advice on the minimization I wrote above and how to translate it to a graph correctly?

PHP – Packing widgets into the fewest number of boxes, plus minimum order quantity

The problem is this:

A company supplies widgets in a set of pack sizes:

  • 250
  • 500
  • 1000
  • 2000
  • 5000

Customers can order any number of widgets, but the following rules apply:

  • Only whole packs can be sent and …
  • No more widgets than necessary should be sent and …
  • The fewest packs possible should be sent

Some examples showing the number of widgets ordered and the required pack quantities and sizes to correctly fulfill the order:

  • 1 (1 x 250)
  • 251 (1 x 500)
  • 501 (1 x 500 and 1 x 250)
  • 12001 (2 x 5000 and 1 x 2000 and 1 x 250)

I’ve looked at some algorithms (greedy coin change, LAFF, etc.) as these seem to provide similar solutions, but can’t seem to see how to adapt them to the above.

For example:

function countCurrency($  amount)  {      $  notes = array(5000, 2000, 1000, 500,                    250);      $  noteCounter = array(0, 0, 0, 0, 0);       // count notes     for ($  i = 0; $  i < 5; $  i++)       {          if ($  amount >= $  notes[$  i])          {              $  noteCounter[$  i] = intval($  amount /                                         $  notes[$  i]);              $  amount = $  amount -                         $  noteCounter[$  i] *                         $  notes[$  i];          }      }           // Print notes      echo ("Currency Count ->"."\n");      for ($  i = 0; $  i < 5; $  i++)       {          if ($  noteCounter[$  i] != 0)           {              echo ($  notes[$  i] . " : " .                    $  noteCounter[$  i] . "\n");          }      }  }   $  amount = 12001;  countCurrency($  amount); 

How come my Tkinter entry boxes are classified as “NoneType”?

I am trying to make a tkinter program that calculates the land transfer tax. When I run this code, it gives me the following error when I try to calculate it:

Exception in Tkinter callback Traceback (most recent call last):   File "C:\Users\Angela\AppData\Local\Programs\Python\Python37-    32\lib\tkinter\__init__.py", line 1705, in __call__     return self.func(*args)   File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 16, in <lambda>     ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)   File "C:/Users/Angela/PycharmProjects/Editor/Editor.py", line 19, in callback     price = entry_box.get() AttributeError: 'NoneType' object has no attribute 'get' 

Here is the code that I have:

master = Tk()  label = Label(master, text="Price of house: ").grid(row=0) entry_box = Entry(master).grid(row=0, column=1)  ok = Button(master, text="Calculate tax", command= lambda: callback(master, entry_box)).grid(row=0, column=2)  def callback(master, entry_box):     price = entry_box.get()     price = int(price)     tax_price = 275     if price > 55000:         tax_price += (250000 - 55000) * 0.1     else:         tax_price += 55000 * 0.05     if price > 250000:         tax_price += (368333 - 250000) * 0.15     if price > 368333:         tax_price += (400000 - 368333) * 0.15     if price > 400000:         tax_price += (2000000 - 400000) * 0.2     if price > 2000000:         tax_price += (price - 2000000) * 0.25     show_tax_price = Label(master, text=tax_price).grid(row=0, column=3)    mainloop() 

Can someone tell me what is wrong with my program?

What are these little yellow boxes at German pedestrian crossings?

I’ve been to Germany twice now: Once to Berlin and once to Bielefeld.

Both places had these yellow boxes with the same pattern at pedestrian crossings.

enter image description here

At first I thought they were to press for crossing, but there doesn’t seem to be any way to actually press them so I’m confused as to what their role is.

What exactly are they for?

Should I save the original boxes for lenses and cameras?

I have a lot of original boxes for cameras and lenses. In fact, I have a closet and the entire bottom half of it is empty original boxes from photographic equipment.

I have been photographing for 30 years and never sold a lens or camera second hand and do not anticipate doing so, so keeping the boxes for a boost in resale value seems questionable. Also, how many people really want to buy a consumer grade lens from a second rate company that is 20 years old?

So, I am thinking of just chucking the boxes. Is there any reason not to do so?