Choosing an AI method to recreate a given binary 2D image

If the title wan not very clear, I want a method to take an input image like this,

[[0, 0, 0, 0],  [1, 1, 1, 0],  [1, 1, 1, 0],  [0, 1, 1, 0]] 

and output the 2D coordinates of the 1s of the image (So that I can recreate the image)

I want the output to be sequential because I need to reconstruct the input image pixel by pixel and there are some conditions on the image construction order (e.g. You cannot place a 1 somewhere when it is surrounded by 1s)

The image can change and the number of 1s in the image too.

  1. What is an appropriate AI method to apply in this case?
  2. How should I feed the image to the network? (Will flattening it to 2D affect my need of an output order?)
  3. Should I get the output coordinates one by one or as an ordered 2xN matrix?
  4. If one by one, should I feed the same image for each output or the image without the 1s already filled?

EDIT: The application is a robot creating the image using some kind of building blocks, placing one block after the other


I have tried to apply "NeuroEvolution of Augmenting Topologies" for this using neat-python but was unsuccessful. I am currently looking at RNNs but I am not sure if it is the best choice either.

Remove table from DEFUNCT filegroup so we can recreate the table again in a different online filegroup

We have a BIG production database. We also have STG and UAT servers, where we restore the PROD database. One of the biggest tables (+250 GBs) in this PROD database is in the SECONDARY filegroup. We need the table in UAT an STG, but we don’t need the data we have in PROD. My solution was to restore only the PRIMARY filegroup; that way, the restore process is faster, and also we need a lot less space since the secondary filegroup is big. We don’t want to restore the secondary filegroups in the future, so I defunct the Secondary filegroup.

The table in the secondary filegroup remains inaccessible. If I try to query the table, I get: The query processor is unable to produce a plan for the table or view ‘tablename’ because the table resides in a filegroup that is not online.

I would like to create the table accessible again, an empty table, and even if it’s on the PRIMARY filegroup. I tried to DROP the table so I can recreate it in PRIMARY filegroup, but since the SECONDARY filegroup is offline, I get an error. Also, If I try to recreate the table in PRIMARY filegroup, it says the table already exists.

As I said, we need the table for the app to work in UAT/STG, but we don’t need the data, and we don’t have the space to restore the secondary filegroup.

Any ideas?

Thanks!

Best way to recreate a GrubHub-like spatial database

So I am currently working on a project very similar to GrubHub, UberEats, PostMates, etc. Without getting into too much detail about the project idea let’s say I was just recreating one of these aforementioned platforms since we share the same problem. The problem being how to structure a database that is efficient for querying geographically proximity-based and also being able to take into account other input parameters such as food types, specific food items, etc.

Currently, I am using Firebase’s Cloud Firestore NoSQL database to create “restaurant” objects and storing them using a UID. Obviously, this solution doesn’t scale if say their were a million objects I would be stuck having to fetch all of them and then say calculate the distance between the user and the restaurant’s location. And then after filtering through that I would have to query for other input parameters like I mentioned before.

I’ve never worked with spatial/geographic-based databases so I’m looking for recommendations on how to best store each restaurant object using one value to use as a “key”. As well as recommendations on how to filter it again using “fuzzy” input parameters. And by fuzzy I mean like typing in for example, “tamales” and the database knowing to search not only tamales the food item but also related results like Mexican food in general.

Is there a way to recreate the code behind the for loop?

My question is, how would I go about making a function that serves the same purpose of the for loop, without using any loop method.

function fl (initial, condition, iterator, code){     i = initial;     if(condition){         code()     }     i = i + iterator     // Somehow repeat without using any loop }  // The function would then be utilized like so  fl(0, i <= 5, 1, function(){     console.log("This is a loop") } 

The parallel of the loop would be

for(i = 0, i <= 5, i++){     console.log("This is a loop") } 

Is this even possible?

Recreate old aliases in bulk to reduce their file size, keeping their name and creation date

I noticed that in recent versions of macOS, aliases I create are smaller than they used to be. I have a folder full of old aliases whose sizes range from 50 KB to 6 MB, but new aliases seem to be always less than 1 KB.

I want to recreate all my large, old aliases to save disk space. I know I can update an individual alias by finding the file the alias points to, deleting the alias, and option-command-dragging the original to where the alias was. However, this loses the Date Created of the alias, and more steps are needed to preserve the name of the alias if it is different from the original file. Also, this would take too long to do for my hundreds of aliases. How can I shrink my aliases in bulk while preserving the name and Date Created?

There is another, very similar question Recreate an alias with the same name and timestamp programmatically. The difference is that that question requires an answer that doesn’t change the Date Modified of the alias. I am fine with the Date Modified being updated, as long as the Date Created is unchanged.

How does an AB Weird Science recreate their Trapping items if lost/destroyed?

How does an AB Weird Science recreate their Trapping items if they are lost or destroyed?

P.148 says they must always use their item … A weird scientist’s Trappings (see page 150) must always include the item they’re associated with. 

Then the example on p.149 in Jury Rigging shows them being able to use a power, albeit at the -2, after the item is lost … Gabe is captured by evil aliens and all his equipment is taken. He’s placed in a holding cell and decides he’ll use the overhead lights and whatever the aliens use for electricity to create a makeshift blast. 

But how does Gabe ever recreate his item?