c #: detection of an isolated voxel bubble in a 3D cube with the first amplitude search

I recently got into c # and Unity coding, and I'd like to put this algorithm and code for review to verify how I'm doing. I have only been working alone, so it would be interesting to know how the design and style of my code could be improved.
The task is like this:

There is a 3D cubic grid (stateGrid) that contain voxels that are 1 or 0. It is stored as a flattened matrix. If several voxels 1 are neighbors to each other, they form an island together.

I want to detect islands smaller than a certain size (blobMin), and convert them to 0. The function returns the voxels that are part of the islands for elimination.

Checking if voxel is on an island is implemented with an amplitude search in the Walker function.

Performance is quite important, since the cube can be 64 or even larger, and I think there is still much to gain algorithmically.

Here is my code:

using System.Collections.Generic;
using UnityEngine;

public class IslandRemove{
    private int mapSize;
    private int mapCubeSize;
    private float() state;
    private float() result;
    private int index;
    private int connectCount;
    private int blobMin;

    private HashSet history;
    private Queue queue;
    private int blobSz;


    public IslandRemove(int mapSize, int mapCubeSize, int blobMin){
        this.mapSize = mapSize;
        this.mapCubeSize = mapCubeSize;
        this.blobMin = blobMin;
        result = new float(mapCubeSize);
    }

    private int getIdx(Vector3Int v){
        return v.z * mapSize * mapSize + v.y * mapSize + v.x;
    }

    private void ProcessNode(Vector3Int newVect){
        // if not already in history
        if (!history.Contains(newVect)){
            blobSz++;
            // add node to queue for later check
            queue.Enqueue(newVect);
            // mark node as counted so we don't count again, or check its connections
            history.Add(newVect);
        }
    }

    private bool walker(int x, int y, int z){

        blobSz = 0;
        queue = new Queue();
        history = new HashSet();
        ProcessNode(new Vector3Int(x, y, z)); // queue start position
        var loopcount = 0;

        while (blobSz < blobMin){
            loopcount++;
            var node = queue.Dequeue();
            var idx = getIdx(node);

            // check edges
            if (node.x != 0){ // edge x-
                if ((int)state(idx - 1) == 1)
                    ProcessNode(new Vector3Int(node.x - 1, node.y, node.z));
            }
            if (node.x != mapSize - 1){ // edge x+
                if ((int) state(idx + 1) == 1)
                    ProcessNode(new Vector3Int(node.x + 1, node.y, node.z));
            }
            if (node.y != 0){ // edge y-
                if ((int) state(idx - mapSize) == 1)
                    ProcessNode(new Vector3Int(node.x, node.y-1, node.z));
            }
            if (node.y != mapSize - 1){ // edge y+
                if ((int) state(idx + mapSize) == 1)
                    ProcessNode(new Vector3Int(node.x, node.y+1, node.z));
            }
            if (node.z != 0){ // edge z-
                if ((int) state(idx - mapSize*mapSize) == 1){
                    ProcessNode(new Vector3Int(node.x, node.y, node.z-1));           
                }
            }
            if (node.z != mapSize - 1){ // edge z+
                if ((int) state(idx + mapSize*mapSize) == 1)
                    ProcessNode(new Vector3Int(node.x, node.y, node.z+1));
            }

            if (queue.Count == 0){
                return true; // add to removelist
            }
        }
        return false; // target is reached, don't add to removelist
    }

    public List IslandRemover(float() stateGrid){
        state = stateGrid;
        var remove = new List();
        var removeThis = false;
        var lastOneWasOne = false; // start with false
        // iterate through cube
        for (int z = 0; z < mapSize; z++){
            for (int y = 0; y < mapSize; y++){
                for (int x = 0; x < mapSize; x++){
                    var idx = z * mapSize * mapSize + y * mapSize + x;
                    if ((int) state(idx) == 1 && !lastOneWasOne){ 
                        removeThis = walker(x, y, z);
                        if (removeThis)
                            remove.Add(new Vector3Int(x,y,z));
                        else{
                            lastOneWasOne = true;
                        }
                    }
                    else{
                        lastOneWasOne = false;
                    }

                    if ((int)state(idx) == 0){
                        lastOneWasOne = false;
                    }
                }
            }
        }
        return remove;
    }
}

Thanks in advance!

network – How can I create an isolated and anonymous operating system inside my employer's laptop?

My employer monitors every website I visit on the company's laptop, so I need to create an isolated operating system and connect to an invisible VPN so that the IT department doesn't know what websites I visit and shouldn't even know that I am connected to a VPN and use isolated OS.

My solution would be:

  • Qubes and earn 10 inside him

  • A Stealth VPN service like Nordvpn (that the network won't know that I'm connected to vpn)

  • Maybe a usb to save and connect at any time

  • My mobile phone 4g internet or company wifi (?)

Note: It is not necessary to have complete anonymous systems such as whonix, tails, etc. I just need to browse the web for my personal needs and save my personal documents. Therefore, the Windows operating system is required.

What solution would be fine?

Is a fully isolated multi-lease on Android comparable to Linux possible?

Is it possible to have on an Android device:

  • (permission-based or virtual volumes) isolated data storage?
  • Configuration of device use independent and user-specific?
  • simple user re-entry?

Teamwork: how do you standardize the coding style among multiple isolated developers?

We are a small / medium sized company with a dozen software developers that develop our own internal software for internal use. Since we are very few and there is a lot of work to do, for the most part, each developer manages a separate part of the system and does not share much of his work with other developers. Each one has his "domain", so to speak.

Occasionally, however, the domains overlap and we need to collaborate; and also the agreement means that it is difficult to replace people and when something goes wrong we must be there to fix things because nobody else can do it (at least not quickly). Therefore, this arrangement is pleasant (each of us has total creative control) and not pleasant (basically we are obliged to be on call 24 hours a day, 7 days a week, although in practice it is a bit more relaxed than that).

Recently we tested a small "workshop" among us to promote some better coding standards, namely unit tests. (Yes, we are one of the people who has not yet done so …) During the 2-hour meeting, our goal was to create a small sample program with unit tests, just to get an idea of ​​how to do it.

They were 2 hours of fun, and in the end we managed to produce a bit of code, however, an interesting topic became painfully obvious: after having lived so long in isolation for so long, each of us basically has our own coding style.

Now, I'm not talking about eyelashes vs spaces, camel box versus snake box or some other cosmetic difference. I am talking about the principles of code organization. How to name things. In what folders and namespaces to place them? Do I divide this code into 3 classes or just one? 5 small files or 1 gigantic? Do you abstract it with interfaces and factories, or call it directly? Getters and setters or naked fields? Etc.

Sometimes, writing the absolutely trivial program almost turned into a shouting match, although fortunately we were able to remain calm in the end and no feeling was hurt.

So this made me wonder: how is the coding style normalized among multiple developers experienced with each their own strong preferences? The different styles certainly They are annoying when do They need to interact with the codes of others, not to mention that they are confusing for newcomers. And when a piece of domain code is transferred from one person to another, there is always a strong desire to rewrite it to match its own modes.

First, is there any rule on how to design your code? Any standard? So far I have only seen cosmetic things about spaces and cases. Basically, how to format your code once it is written (at least in your head). But is there any guide on how to write Your code, how to organize it and how to name it? Where and how to divide it into pieces and how to make them interact?

If there is no standard and we need to create ours, how is it done when everyone has a solid opinion about what is right and what is wrong? Now, look, we are all experienced developers here; We realize that none of our approaches is inherently better or worse than any other, only that each of them has certain strengths and weaknesses. But we also have a strong opinion about which strengths and weaknesses are the most important. So how do you decide on The Right Way ™ and how do you ensure that everyone adheres to it without hurting any (too much) feelings?

One way I've heard is to select a Glorious Leader who then forces his favorite style to others (through code reviews and meetings and whatever), but … you need a really good Glorious Leader who is really above of others. . What if you don't have one and we really are all the same here?

java – Eclipse Indigo does not lift, strange and isolated case

it turns out that I work with java, and we use indigo …

Only the following problem happens to me:

Being the server raised correctly (with a delay of 1.35 minutes), I download it and create a method or function, but the problem is that when deploying it does not lift me, it takes me too long … 7 minutes or sometimes it tells me started failed.

Bad solution: they pass me a whole ws folder and wash me there perfectly. I don't know what it can be anymore,

Quiaza is the configuration of the eclipse, I deleted caches and that and I still don't know where it fails …

The server log does not show the cause.

Did anyone have this problem?

transaction – How is the single SQL statement isolated?

All the books I've seen so far talking about transactions show scenarios with several SQL statements involved.

But what about the individual statements? What level of isolation do they have? Is it specified somewhere in a standard? Or does it depend on RDBMS and the level of isolation?

Let me show you a couple of examples.

  1. UPDATE table SET value = value + 1 WHERE id = 1;

    This is a compound. read-update-write operation. Can a parallel transaction change the value between read Y write operations? Some books claim that this operation is atomic (in the sense of multithreaded programming) in the most RDBMS.

  2. SELECT * FROM table t1 JOIN table t2 USING (id);

    If the table is quite large (or the query would have a complicated filtering clause), is it possible at some level of isolation that t1.* Y t2.* columns would differ due to the parallel update?

  3. SELECT * FROM table1 WHERE id IN (SELECT t_id FROM table2);

    Is it possible that some records of table1 Are they removed after the secondary selection has been executed? (Here I guess table2.t_id references table1.id with cascade extraction.)

  4. CTE …

Links to useful manuals that fully explain all the details of the transactions are also appreciated.

Prove that the set consists of a closed isolated point [on hold]

Please help me to try it. Prove that the set consists of a closed isolated point

pathfinder 1e – If the isolated Grimoire caster dies, is the hidden spell book lost forever?

Regardless of the life or death of the caster, an extraplanar expedition can be set up to find it.

You could also use the Discern location spell out. With so much magic, one could throw Plane change, then Major Teleport, then Plane change, then Major Teleport to get the object more succinctly.

If one did not try Steal the spell book but just trying to recover Without a doubt, it would be simpler to simply give life to the dead caster, and then have them cast the spell to return the book, which would also work.

Beyond that, one could make use of a myriad of contingency plans that the original launcher could have used to make recovery easier or more accessible to obtain the book, for example, by placing a ring door near it. or making use of any version of the Refuge spell out. Many of these additional means to access the volume will have their own forms of exploitation or use.

Finally, unlike leomund's secret chest (same link as above), the isolated grimoire is not protected against Wish. Wish You can move any person anywhere through any barrier without possibility of failure unless specifically protected, so, of course, that would also work: you could also go directly to the book and pick it up that way, depending on how rule the GM You can describe locations. If not, you can always try to use the spell's open abilities (or Miracle), but there are no reasons to do so.

pathfinder 1e – Isolated grimoire and death

Regardless of the life or death of the caster, an extraplanar expedition can be set up to find it.

You could also use the Discern location spell out. With so much magic, one could throw Plane change, then Major Teleport, then Plane change, then Major Teleport to get the object more succinctly.

If one did not try Steal the spell book but just trying to recover Without a doubt, it would be simpler to simply give life to the dead caster, and then have them cast the spell to return the book, which would also work.

Beyond that, one could make use of a myriad of contingency plans that the original launcher could have used to make recovery easier or more accessible to obtain the book, for example, by placing a ring door near it. or making use of any version of the Refuge spell out. Many of these additional means to access the volume will have their own forms of exploitation or use.

Finally, unlike leomund's secret chest (same link as above), the isolated grimoire is not protected against Wish. Wish You can move any person anywhere through any barrier without possibility of failure unless specifically protected, so, of course, that would also work: you could also go directly to the book and pick it up that way, depending on how rule the GM You can describe locations. If not, you can always try to use the spell's open abilities (or Miracle), but there are no reasons to do so.

In-game engine editor versus isolated / external engine editor

I was wondering if you knew or could go to a place where I can understand which one is better:

  • Allow users to have an in-game game engine editor

OR

  • Have the game engine editor as a separate program, such as a game engine editor (ue4, unity, etc.)

Let me know, thanks guys!