magento2 – Is it safe to manually remove entries on the db_schema_whitelist.json file?

I am wondering if it is safe to manually remove entries on the db_schema_whitelist.json file. I created a table called customer_address_relationshipusing the declarative schema approach and then I generated the db_schema_whitelist.json first and ran the php bin/magento setup:upgrade command. The generated db_schema_whitelist.json file had the following entries:

{
    "customer_address_relationship": {
        "column": {
            "entity_id": true,
            "customer_id": true,
            "address_id": true
        },
        "constraint": {
            "PRIMARY": true,
            "CSTR_ADDR_RELATIONSHIP_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
            "CSTR_ADDR_RELATIONSHIP_ADDR_ID_CSTR_ADDR_ENTT_ENTT_ID": true
        }
    }
}

I then later decided to change my approach to the problem at hand and had to drop the customer_address_relationship table (by removing it from db_schema.xml and generating db_schema_whitelist.json again and then running setup:upgrade). The better approach was to add a column instead to an existing table called customer_address_entity after adding the column in my db_schema.xml and generating the db_schema_whitelist.json file the content of the file was now as follows:

{
    "customer_address_relationship": {
        "column": {
            "entity_id": true,
            "customer_id": true,
            "address_id": true
        },
        "constraint": {
            "PRIMARY": true,
            "CSTR_ADDR_RELATIONSHIP_CSTR_ID_CSTR_ENTT_ENTT_ID": true,
            "CSTR_ADDR_RELATIONSHIP_ADDR_ID_CSTR_ADDR_ENTT_ENTT_ID": true
        }
    },
    "customer_address_entity": {
        "column": {
            "address_type": true
        }
    }
}

Since I no longer need the table customer_address_relationship is it safe to alter the generated db_schema_whitelist.json and remove its entries? what is the implication of this if there is any?

cryptography – Signing a text file using a pfx file in java

I’m very new to java cryptography. I’m trying to use a .pfx file that contains a public key, it’s private key and a digital certificate to sign a text file. I have been able to access the private key and certificates by loading the .pfx file to the java key store. I want to sign the data using the private key in the .pfx file and then append the digital certificate along with it. This snippet is what I wrote to generate a simple raw signature

I want to be able to do the same using the private key and certificate I get from the .pfx file. This is how I've loaded the key and certificate to the Java key store.

I’ve been stuck at this point for quite sometime. Kindly point me in the right direction. Thank you.

html – Must the image url in a sitemap file begin with the same domain the file is stored on?

I remember when making a sitemap, all URLs defined in between <loc> and </loc> must be part of the same domain as the domain the file is stored on. For example, I can use this line in my sitemap…

http://an.example.com/abc.html

…Only if the sitemap is stored on and publicly accessible from the folder mapped to the an.example.com domain.

But that entry above won’t work if the sitemap is stored on a folder representing a different domain such as y.example.com or even domain.com.

My question is, should I use the above thinking when trying to index for Google images? For example, do image URLs defined in <image:loc> and </image:loc> have to contain the same domain as the location of the sitemap file the entries are contained in?

The reason why I ask is because I have two subdomains. Let’s call them t.example.com and i.example.com. T is for text, and I is for images.

My site map for one page currently would look like something as follows:

<url>
<loc>http://t.example.com/page-one.html</loc>
<image:image>
<image:loc>http://i.example.com/image-one</image:loc>
<image:title>Some image</image:title>
</image:image>
</url>

Am I wrong with using a different subdomain to reference the image? Assume the sitemap file is stored and accessed at http://t.example.com/sitemap.xml

Microsoft.SharePoint.Client.ServerException when trying to upload local file to SP

That is because the SharePoint Server cannot read the file from the path you are providing as the SharePoint will be on a different server and the File Path that you are passing is of your local system.

While calling the Document Upload function you need to pass the Bytes Stream of the document to the SharePoint will then will be converted by SharePoint into a file and will upload it then.

Please refer this code sample

if (_FileUpload.HasFile)
{
   byte() byteArray= _FileUpload.FileBytes;
   MemoryStream stream = new MemoryStream(byteArray);
   string filename = _FileUpload.FileName;
   string result = MyUploadFunction(filename, stream);
}

This will convert your file into a stream. Then in the document upload function use the following code

newFile.ContentStream = stream;

This will upload the file to SharePoint by converting the file stream into original file type with content.

windows 10 – Does data recovery of file depends on its extension?

A file is basically data on a physical file system and a reference on logical file system. The file name including its extension is part of the logical layer. Once a file is removed from this layer, the physical blocks (now without a reference from the logical layer) are marked as available. In this stage, the contents of the file are still readable until it gets overwritten with another file, but the name and extension are gone.

Therefore, data recovery of a removed file depends more on the data format than the extension. Some formats are, unless the file was fragmented, easier to recognize by clear and strictly defined beginnings and endings. Some examples include:

  • JPEG images (and derived formats) are sequences of segments, each beginning and most ending with a marker, like 0xFFD8 Start Of Image and 0xFFD9 End of Image.
  • A ZIP archive consist of file entries and ends with a central directory referencing these files. It is like a small file system within a single file.
  • TAR archives have a 512 byte header for each file followed by the file rounded up to multiple of 512 bytes and padded (typically with zeroes).
  • From text files, e.g., XML is easy to recognize, as it may start with <?xml and consists of root element and child elements, each having a defined ending.
  • Modern Microsoft Office files a.k.a. Office Open XML files are ZIP packed XML-based documents.

As these files are that recognizable, they are faster to recover. The time depends on how many formats there has to be defined, recognized and analyzed. E.g., if you know you are only after JPEG images you can narrow this process down to JPEG markers.

java – OBJ file loader texture coordinates not loading correctly

I’m trying to create an OBJ file loader for my 3D game library (with Java and LWJGL), but having issues with loading texture coordinates (and normals too but I assume they’ll apply the same as texture coords). I should get a Suzanne head looking like this, but instead looks like this.

Here’s the code:

int bytesLoaded = 0;
ArrayList<Float> vertices = new ArrayList<>();
ArrayList<Float> textureCoords = new ArrayList<>();
ArrayList<Float> normals = new ArrayList<>();

ArrayList<Float> plainTextureCoords = new ArrayList<>();
ArrayList<Float> plainNormals = new ArrayList<>();

ArrayList<Integer> vertexIndices = new ArrayList<>();
ArrayList<Integer> textureCoordIndices = new ArrayList<>();
ArrayList<Integer> normalIndices = new ArrayList<>();

ArrayList<String> textureCoordsAdded = new ArrayList<>();
ArrayList<String> normalsAdded = new ArrayList<>();

String line;
try {
    InputStream stream = IO.class.getClassLoader().getResourceAsStream(filePath); //get file off classpath
    BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); //create file reader
    while((line = reader.readLine())!=null) { //repeat until document's end has been reached
        String() data = line.split(" "); //split line into each data point
        
        textureCoords.add(0.0f); //filler
        normals.add(0.0f);
        
        if (line.startsWith("v ")) { //add vertices in the 3 data points, exculding the first which is the "v"
            for (int i=1; i<4; i++) {
                vertices.add(Float.parseFloat(data(i)));
            }
            
        } else if (line.startsWith("vt ")) {
            for (int i=1; i<3; i++) {
                plainTextureCoords.add(Float.parseFloat(data(i))); //add vertex textures in the 2 data points, excluding the first which is the "vt"
            }
            
        } else if (line.startsWith("vn ")) {
            for (int i=1; i<4; i++) {
                plainNormals.add(Float.parseFloat(data(i))); //add vertices in the 3 data points, excluding the first which is the "vn"
            }
            
        } else if (line.startsWith("f ")) { //indices
            for (int i = 1; i<4; i++) {
                String() faceIndices = data(i).split("/"); //split each face into v indice, vt indice and vn indice
                for (int j = 0; j<3; j++) {
                    switch (j){
                    case 0:
                        vertexIndices.add(Integer.parseInt(faceIndices(j)) - 1); //minus one as OpenGL indices are 0 indexed, not 1
                        break;
                    case 1:
                        textureCoordIndices.add(Integer.parseInt(faceIndices(j)));
                        break;
                    case 2:
                        normalIndices.add(Integer.parseInt(faceIndices(j)));
                        break;
                    }
                }
            }
        }
        bytesLoaded = bytesLoaded + line.getBytes().length; //just keep track of bytes loaded
    }
    
    for (int i = 0; i<textureCoordIndices.size(); i++) { //process texture coords
        int index = textureCoordIndices.get(i),
                pos =  index * 2 - 2; //times 2 to get the location (2 vt's) and minus 2 to be 0 indexed
            float targetCoord1 = plainTextureCoords.get(pos), //get the texture coords
            targetCoord2 = plainTextureCoords.get(pos + 1);
            String combined = String.valueOf(targetCoord1).concat("+").concat(String.valueOf(targetCoord2)); //Generate an 'ID' for the 2 vertex coords
                if (!textureCoordsAdded.contains(combined)) { //Check if that ID has already been processed
                    textureCoordsAdded.add(combined); //Add that ID to the list of processed indices
                    
                    int controlIndice = vertexIndices.get(pos); //Align the position of the texture coord with the vertices indices (OpenGL only uses vertex indices)
                    textureCoords.add(controlIndice, targetCoord1); //Add the texture coords to the correct position
                    textureCoords.add(controlIndice + 1, targetCoord2);
                }
        }
    
    for (int i = 0; i<normalIndices.size(); i++) { //process normals
        int index = normalIndices.get(i),
                pos =  index * 3 - 3; //times 3 to get the location 32 vn's) and minus 3 to be 0 indexed
                    float targetNorm1 = plainNormals.get(pos), //get the normals
                    targetNorm2 = plainNormals.get(pos + 1),
                    targetNorm3 = plainNormals.get(pos + 2);
                String combined = String.valueOf(targetNorm1).concat("+").concat(String.valueOf(targetNorm2).concat("+").concat(String.valueOf(targetNorm3))); //Generate an 'ID' for the 3 vertex normals
            if (!normalsAdded.contains(combined)) { //Check if that ID has already been processed
                    normalsAdded.add(combined);//Add that ID to the list of processed indices
                
                    int controlIndice = vertexIndices.get(pos);  //Align the position of the normals with the vertices indices (OpenGL only uses vertex indices)
                    normals.add(controlIndice, targetNorm1);
                    normals.add(controlIndice + 1, targetNorm2); //Add the normals to the correct position
                    normals.add(controlIndice + 2, targetNorm3);

            }
    } 
} catch (IOException|NullPointerException e) {
    System.err.println("File " + filePath + " not found!");
    Manager.terminate();
}

I think this might be to do with my understanding of the obj file format, rather than the implementation, but I cannot be sure.

virtual reality – package-lock.json file for in Unity?

Since I’ve been asked to reformat my question, here it is :

Under Unity 2020 and behond…

I think that my package package-lock.json is corrupted, and block the fabrication of the build.

Could it be possible to :

  • Erase, or regenerate it ?

  • What damages it will create if I just delete the content of the folder ?

cheers
weex

SharePoint 2016 There is no file with URL ‘_catalogs/wp/DocumentSetProperties.dwp’ in this Web

I have a new installation of SharePoint server 2016, I have setup a new web application and now trying to create a new site collection and I am getting the error :

There is no file with URL ‘_catalogs/wp/DocumentSetProperties.dwp’ in
this Web.

I redid the web application a few times without any success.
thanks for any help

Edit: With poweershell I get the error

New-SPSite -Url $Site -OwnerAlias $Owner -Template STS#2

New-SPSite : There is no file with URL
‘_catalogs/masterpage/v4.master’ in this Web

Here is the full powershell script:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$siteURL = "http://somewebapp.com/sites/test2"
$sitePrimaryOwner = "domainsecretusername"
$siteSecondaryOwner = "domainsecretusername"
$siteName = "Test Site"
$siteTemplate = "STS#0"
$siteDescription = "This is a test site"

New-SPSite -Url $siteURL -OwnerAlias $sitePrimaryOwner -SecondaryOwnerAlias 
$siteSecondaryOwner -Name $siteName -Template $siteTemplate -Description 
$siteDescription

Intellij – Erro Java – Gradle sync failed: Cannot convert relative path ~/GRADLE_HOME/daemon/6.8 to an absolute file

Boa noite pessoal.

O problema esta aparecendo sempre que tento rodar o programa, e as packages do programa não aparecem também. Abri o mesmo projeto pelo VSCode e funcionou normalmente por la, só não esta funcionando pelo Intellij.

synology – What GUI file explorers exist (Mac or Windows) to browse folders with wildcards?

I use a synology NAS, and have snapshots enabled. This creates a bunch of timestamped copies of folders in a #snapshots directory for each share. For instance, if I have the folder homes/alex/my/folder/structure/ (where “homes” is a default share in DSM), I also have the folders homes/#snapshots/<timestamp1, timestamp2, timestamp3, etc>/alex/my/folder/structure/ containing snapshots of the structure folder at all the timestamps it existed for. This whole structure is available to browse on a client machine via SMB, assuming you’ve enabled that and have a credentialed user and so on.

If I want to find all the snapshots of structure on MacOS, I can use the terminal command `ls /Volumes/homes/#snapshot/*/alex/my/folder/structure/’.

This is a little cumbersome both because it requires a lot of typing but also because it lists the entire contents of the structure folder at every snapshot, in addition to which snapshots there are.

In a perfect world, finder would just have a dropdown menu on the folder path entry where I could see all the other folders at this level containing this same path I’m on, and could quickly switch between them. They do something similar with much more visual cruft in the Time Machine interface, but that’s not generally applicable.

Is there any GUI a-la Path Finder/Forklift/etc that has this kind of function?