I’ve got enums on top of enums, and then some more traits for those enums… it’s getting unwieldy

So I have an enum wrapping an enum, but I have another enum talking about what that enum is.

Which makes for a confusing English sentence, so here’s an example.

I got one enum:

enum Example {     A(Something),     B{ structfield: K },     C(Gamma, Third),     D(InsertSomethingElseCrazyHereThatCantImplementANYTraitsCauseReasons), } 

Which is all fine and dandy, but I needed another way to categorize them and compare the categories without matching. I also needed to pass along Examples without fields, and then I realized that I should probably use an enum describing my enum, so I ended up doing this:

#[derive(Eq, PartialEq, YouGetThePoint)] enum ExampleCategory {     A, B, C, D } 

Then, cause I wanna easily go from Example to ExampleCategory:

impl From<Example> for ExampleCategory {     fn from(e: Example) {         match e {             Example::A(_) => ExampleCategory::A             Example::B{..} => ExampleCategory::B             Example::C(_,_,_) => ExampleCategory::C,             Example::D(_) => ExampleCategory::D         }     } } 

So now, every time I need to add an Example, I end up needing to change code in three different places, and if I want a new trait... etc. Also, if theSomethinginExample::A` were another kind of this enum. *shudders

I think I made my point on why this is probably a bad idea.

I’m 90% positive there’s a better way to do this (that doesn’t involve macros since I don’t even know how I would go about doing that). How would I change this to be more DRY/better? Since the Example enum is actually a part of a larger issue.

I’ve noticed that Windows 7 tends to boot much slower when I open the Windows boot disk. Anyone else notice this?

I now try to avoid opening the windows boot partition, because when I open and look at it, my Windows 7 takes inordinately long to boot. . . I’ve taken to using a non boot NTFS partition to store shared files. Is there some problem with Linux’s handling of the Win7 boot partition? Anyone else notice this?

Google Maps – requests to reviews places I’ve never visited

Google Maps insists on asking me to review places that I’ve never visited. I’ve tried both “Dismiss” and “I haven’t been here”” but they keep coming back. It’s very frustrating especially when the places I have visited and I do want to review get lost in the seemingly endless list of places I’ve perhaps gone past but never visited.

I’ve Forgotten The Gmail I Used To Create A Youtube Channel

2 years ago I created a YouTube channel, because I wanted to start making videos as a hobby. I uploaded a grand total of one video and promptly forgot about it. Now I want to try and get back into it, but I can’t remember what email I used.

It’s not in YouTube’s “Accounts” list anymore, nor is it in my GMail account list. The problem is that I don’t think I set my main GMail as a recovery account. When I run the Account Recovery process, it ends up giving me an unrelated list of accounts. The phone number is inactive, so I can’t send any recovery SMSes to it either.

Scrolling back to January 2017, I can see the automated email from YouTube telling me that I was about to upload the video, but no sign of any sort of email telling me that I’d set my main email as a recovery. This makes me think that I DID set my main email as a recovery though. Why else would I get that email? Unless Google Accounts just do that somehow.

There’s no trace of the email anywhere in my “All Mail” filter. I’ve used YouTube, Google, and my channel’s name all as search terms but nothing pops up.

So in short, I have no way of tracking down the email. I’ve tried sitting down and brute forcing the email until something works, but nothing ever happens. Is there anything I can do at all?

Thanks in advance,

Adam

Sorting and grouping: What is the name of this type of problem? How do I implement the optimizations that i’ve thought of?

I have a facial recognition algorithm that compares two images A and B and returns the likelihood that they match.

I also have 50,000 images, and I would like to sort these images into groups.

Here’s the immediate way I thought of to do this:

  1. Start with image 0, compare it to all 49,999 images. Store the similarities in an array
  2. Move on to image 2, compare it to 49,998 images. Store the similarities in an array

At the end of it all I’m left with a verified_listof images that matched, and I can basically feed them into a network to combine them, ie if I have a verified_list like so:

[[1,2,3],[2,5,6],[8,9]] (verified_list is the same length as the number of images, so verified_list[1] contains references all the images that image_1 matches with)

then the network graph combines them into:

[[1,2,3,5,6], [8,9]

Indicating I have two groups.

Obviously this is a huge amount of processing, I think it equates to: nCr(50000,2), some huge number!

I would like to add some logic to improve this. I can think of what needs to be done but am not sure how to actually implement it.

Basically I just want to skip as many images as possible without reducing the overall quality of verified_list

Say I’ve arrived at image 4. I can loop through verified_list[1] to figure out if image_4 matches with image_1, but this seems like if I get to image 39,543, I would have to check all 39,542 verified_lists before figuring out if image_39543 has been matched to a group or not

I feel like I’m over complicating this issue quite a bit… Is there a name for this kind of problem? Is there a known best way to do this?

There’s also the issue where the recognition algorithm is not 100% accurate. Ie img_1 matches with img_2 and img_5, but img_5 only matches with img_1 and not img_2.

Help! I’ve renamed a system apk, and the phone is on bootloop now!

I have an xiaomi redmi note 5 rooted: to get rid of the notification system about new updates I’ve renamed the ” Updater.apk ” file on root /system/data/Updater , but now the phone in in bootloop. I’ve tried to rename it back booting from twrp, but after mounted the system partition ( mount /system ) I cannot find the same directories I saw when I was browsing using a root file manager. How can I locate the ” Update.apk ” file and rename it back on its original name? Thank you

Can I download a list of all apps I’ve PAID apple for?

I’ve had an iPhone or iPod touch for years, and have bought tons of little apps, some free, some pay for.

I’d like to get a list of all the apps that I’ve paid for over the years, as there is one I’m trying to find, that I can’t remember it’s name!

When I browse my purchase history, it’s got tons of free items listed as well, as I’ve installed tons of apps.

I’d like to download this list, and filter it to ignore things that were free. I only want to see things I’ve actually paid for.

Is this possible?

Note – I do not want to have to browse through my purchase history… I’d like to just install an app, or whatever I need to do to get a csv or spreadsheet of my purchases. It’d be nice if it included iTunes movie rentals as well 😉 Thanks!

How can I choose the name point I’ve clicked in?

I need to improve this python code. This code is saving mouse clicking coordinates. I would like to set a name in each point I click and set sign where I’ve clicked. Is that possible?

import cv2, numpy as np  # Path to source video: output_path = '/home/stephen/Desktop/clicks.csv'  # Mouse callback function global click_list positions, click_list = [], [] def callback(event, x, y, flags, param): if event == 1: click_list.append((x,y)) cv2.namedWindow('img') cv2.setMouseCallback('img', callback)   img = cv2.imread('/home/stephen/Desktop/test214.png')   # Mainloop - show the image and collect the data  while True:  cv2.imshow('img', img)      # Wait, and allow the user to quit with the 'esc' key  k = cv2.waitKey(1)  # If user presses 'esc' break   if k == 27: break          cv2.destroyAllWindows()   # Write data to a spreadsheet  import csv  with open(output_path, 'w') as csvfile:  fieldnames = ['x_position', 'y_position']  writer = csv.DictWriter(csvfile, fieldnames = fieldnames)  writer.writeheader()  for position in click_list: x, y = position[0], position[1] writer.writerow({'x_position': x, 'y_position': y})