wp query – Modification of the raw data $ _POST at the beginning of the life cycle

Is there a specific plugin way to modify superglobals directly before using them? Assuming that the following code was in a plug-in called aaa, one would imagine that this would run quite early in the request lifecycle. During the execution of the code, when other plugins use the data, they have not been modified.

// file location: wp-content / plugins / aaa / aaa.php

function interfere_with_things(){

    // skip anything not applicable
    if($_SERVER('REQUEST_METHOD') !== 'POST' || empty($_POST('something'))){return;}

    // change something in the $_POST
    $_POST('something') = str_replace('cats', 'dogs', $_POST('something'));

}

add_action('init', 'interfere_with_things', 1);

opengl – How to correctly reset vertex attributes after modification

I am trying to use the same vertex shader for two different use cases to preserve memory, but I have problems where changes from a shader run are passed to the next run, even after being reset. Specifically, I am trying to use the shader to display both a regular texture, while modifying the vertex attributes in some cases to display parts of a texture. The problem is that this "cropping" of the texture is applied to the texture which must be displayed at 100%.

Here's what it looks like, where the sprite on the right is drawn first:
Application screenshot

The two textures only show part of their actual images, but only the left one should. Curiously, the one on the right shows full texture for a second, before being replaced by what is shown. This tells me that the vertex attributes of the first sprite are changed by the second sprite (left), but I don't know how to reset them. Here is my vertex shader:

#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;

out vec2 TexCoord;

uniform mat4 transform;
uniform mat4 view;
uniform mat4 projection;

void main()
{
    gl_Position = projection * view * transform * vec4(aPos, 1.0);
    TexCoord = aTexCoord;
}

Here is how I modify the attributes of the vertices:

void setSelection(Quad selection) {
        vertices(3) = selection.x + selection.w;
        vertices(4) = selection.y + selection.h;
        vertices(8) = selection.x + selection.w;
        vertices(9) = selection.y;
        vertices(13) = selection.x;
        vertices(14) = selection.y;
        vertices(18) = selection.x;
        vertices(19) = selection.y + selection.h;
};
...
float vertices(20) = {
          // positions         // texture coords
          0.5f,  0.5f, 0.0f,   1.0f, 1.0f, // top right
          0.5f, -0.5f, 0.0f,   1.0f, 0.0f, // bottom right
         -0.5f, -0.5f, 0.0f,   0.0f, 0.0f, // bottom left
         -0.5f,  0.5f, 0.0f,   0.0f, 1.0f  // top left
};

This code modifies the texture coordinates of the vertices table displayed. They are applied with this code:

void Sprite::render() {
    // Set shader uniforms if the shader is initialized
    if (shader != nullptr) {
        applyTransforms();
        shader->useShader();
        shader->setMat4("transform", trans);
        shader->setVec4("color", color.asVec4());
        shader->setMat4("view", Camera::getLookMat());
    }

    glBindBuffer(GL_ARRAY_BUFFER, vbo);
    glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
    glBindBuffer(GL_ARRAY_BUFFER, 0);

    tex->bind();

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
}

However, if I have two objects (both instances of the same class), one with a modified array (left) and one with an unmodified array (right, as shown in the image), the modified table takes precedence, and I can & # 39; I don't know how to prevent it from being changed without using another shader object, but I don't want to do that. Is there something missing that would allow me to change the attributes between drawing cycles?

performances – Modification of a small delay before loading in full resolution in Lightroom Classic

While browsing the images in Lightroom, it waits a little (maybe a second or two) on each image before loading the full resolution version (when loading toast appears). I think it is for performance reasons preventing a complete rendering because we pass on images without really needing to load them.

I was wondering if there was a way to adjust this delay?

front end – Modification of the default documentation magnification

Finally, after decades of incorrect rendering of notebooks in Mathematica on Windows, and after many years where Mathematica does not support high resolution displays in Windows, version 12.1 finally fixes these problems. Well, almost

Here is the fly in the ointment: Now, the fonts chosen in the documentation are too large: they use 14-point fonts for the default text, which is ridiculously large. This is probably because in the bad old days, before 12.1, Mathematica made fonts too small (by a factor of 72/96), so the good people of Wolfram simply increased the font size to make the legible documentation. Which means that now, with fonts suddenly rendered correctly, this size is too large. So how do we fix it?

The simplest solution I can see (unless you wait another 25 years for Wolfram to get those damn font sizes …) would be for Mathematica to render all Documentation at a magnification of 0.75, for example. So here is my question:

Is it possible to force Mathematica to display all notebooks for its documentation at a magnification of 0.75? I understood that these notebooks used the style sheet "Reference.nb" which I could modify, in principle (after having copied it in my hierarchy of user folders). I don't know if it's possible to set the magnification of a whole notebook in its style sheet, and if so, how to do it. I could of course change the magnification for each of the different cell types described in Reference.nb, but it's a ton of work, and who knows what I could break by doing it.

Can it be done?

Update of the user field with a multidimensional table after the modification of certain fields

I have a user meta-field called simplefavorites which stores all of the favorite items for users.
Plugin used: http://favoriteposts.com/

This code $all_meta_for_user = get_user_meta( get_current_user_id(), 'simplefavorites' ); get the field:

Array
(
    (0) => Array
        (
            (0) => Array
                (
                    (site_id) => 1
                    (posts) => Array
                        (
                            (1) => 9004111222003228
                            (2) => 9004111222031615
                        )

                    (groups) => Array
                        (
                            (0) => Array
                                (
                                    (group_id) => 1
                                    (site_id) => 1
                                    (group_name) => Default List
                                    (posts) => Array
                                        (
                                            (1) => 9004111222003228
                                            (2) => 9004111222031615
                                        )

                                )

                        )

                )

        )

)

From the data dump, I had to delete messages with the ID "9004111222003228", so I wrote a function to update it.

  function removeElement(array $list, string $search): array {
    foreach($list as $key => $value) {
      if (is_array($value)) {
        $list($key) = removeElement($value, $search);
      } else if ($value == $search) {
        unset($list($key));
      }
    }
    return $list;
  }

And used this to get the updated field:

removeElement($all_meta_for_user, "9004111222003228");

This has given me:


Array
(
    (0) => Array
        (
            (0) => Array
                (
                    (site_id) => 1
                    (posts) => Array
                        (
                            (2) => 9004111222031615
                        )

                    (groups) => Array
                        (
                            (0) => Array
                                (
                                    (group_id) => 1
                                    (site_id) => 1
                                    (group_name) => Default List
                                    (posts) => Array
                                        (
                                            (2) => 9004111222031615
                                        )

                                )

                        )

                )

        )

)

Now that i'm using update_user_meta( get_current_user_id(), 'simplefavorites', removeElement($all_meta_for_user, "9004111222003228") ); I get the following error:

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 122

Notice: Undefined index: posts in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 124

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Helpers.php on line 96

Notice: Undefined variable: ids in /var/www/html/wp-content/toolset-customizations/get_favorite_elements.php on line 30

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 122

Notice: Undefined index: posts in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 124

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Helpers.php on line 96

Notice: Undefined variable: ids in /var/www/html/wp-content/toolset-customizations/get_favorite_elements.php on line 30

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 122

Notice: Undefined index: posts in /var/www/html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php on line 124

Notice: Undefined index: site_id in /var/www/html/wp-content/plugins/favorites/app/Helpers.php on line 96

Notice: Undefined variable: ids in /var/www/html/wp-content/toolset-customizations/get_favorite_elements.php on line 30

I think the way I insert the multidimensional array is not correct.
Do I need to serialize and then update?

New custom forms, modification, display using JSlink. The OOTB SharePoint date picker does not close the pop-up window after selecting the date

I used JSLink to customize the New, Edit and View form. Faced with an intermittent problem with the OOTB date field. When I select the date field at certain times, it does not close the calendar pop-up. I am using IE 11.

(a function () {

document.write('');

var formTemplate = {};

formTemplate.Templates = {};

formTemplate.Templates.View = TestNewFormView;

formTemplate.Templates.OnPostRender = loadNewDocument;

SPClientTemplates.TemplateManager.RegisterTemplateOverrides(formTemplate);

}) ();

TestNewFormView (ctx) function {

var FormTable = "".concat("
", "
{{HODatereceived}}
", ) FormTable = NBPropFormTable.replace('{{HODatereceived}}', getSPFieldRender(ctx, 'HODatereceived'));

}

getSPFieldRender function (ctx, fieldName) {

try {

    var fieldContext = ctx;

    var result = ctx.ListSchema.Field.filter(function (obj) {

        return obj.Name == fieldName;

    });

    fieldContext.CurrentFieldSchema = result(0);

    fieldContext.CurrentFieldValue = ctx.ListData.Items(0)(fieldName);

    return ctx.Templates.Fields(fieldName)(fieldContext);
}

catch (ex) {

}

}

Import, modification from the sheet which is also imported

I'm currently using importrange to get timesheets in a main sheet. I then download this sheet every week and update my KPIs

Since all the information is on the main sheet where all the data is import range data, I would also like to delete / update the timesheets.

For now, I have to go to each other's timesheet to wipe with a button that I did. However, I would like to clear them all using a button in the main sheet, since they are all import range data from many other sheets, this will not allow me to delete data for everything refresh from a single page.

Basically I want to modify the data of the import range from the main sheet, but currently this only works in one direction, is there any way to allow me to modify the import sheet Origin of the import range? Or even a different type of import?

I hope it makes sense and I hope you can help me.

Unity – Unity3D, modification of the mesh of voxel pieces: additional performance improvements

I flattened my 3D block matrix (I have a nice speed of 20 ms), I modified my VertexData structure (which I use in the dictionary as a key) to have a custom hash code (another acceleration of GC.alloc data by 20 ms and -2.7 MB). But I don't know what to do next, because 40 ms always seems long for such a small piece (in fact, it's half the size of Minecrafts 16x256x16 and still manages to be slower.).

My biggest bottleneck always seems to be the dictionary.

Here is the current performance profile:

enter description of image here

The code:

public void MakeChunk()
    {

        vertexCount = 0;
        //these are all Lists except verticesDictionary
        vertices.Clear();
        normals.Clear();
        verticesDict.Clear();
        uvs.Clear();
        triangles.Clear();

        int len = 32 * 32 * 32;

        for (int i = 0; i < len; i++)
        {
            int cubeType = data.raw(i);
            if (cubeType != 0)
            {
                int x = i % 32;
                int y = (i / 32) % 32;
                int z = i / (32 * 32);
                MakeCube(x, y, z, cubeType);
                blocksGenerated++;
            }
        }
    }
    void MakeCube(int x, int y, int z, int cubeType)
    {
        for (int i = 0; i < 6; i++)
        {
            Direction dir = (Direction)i;
            if (data.GetNeighbor(x, y, z, dir) == 0)
            {
                MakeFace(dir, x, y, z, cubeType);
            }
        }
    }
    void MakeFace(Direction dir, int x, int y, int z, int cubeType)
    {
        VertexSignature signature;
        signature.normal = dir;

        Vector3() faceVertices = CubeMeshData.faceVertices((int)dir, x, y, z);
        int() triangleIndices = new int(4);
        signature.cubeType = cubeType;

        for (int i = 0; i < 4; i++)
        {
            signature.position = faceVertices(i);
            Vector3 uv = CubeMeshData.ProjectPositionToUV(signature.position, dir);
            uv.z = signature.cubeType;

            int vertex = GetVertexIndex(signature);
            triangleIndices(i) = vertex;
        }

        triangles.AddRange(new int(6) {
            triangleIndices(0),
            triangleIndices(1),
            triangleIndices(2),
            triangleIndices(0),
            triangleIndices(2),
            triangleIndices(3)
            }
        );


    }
    void PrepareMeshData()
    {
        foreach (var pair in verticesDict)
        {
            int index = pair.Value;
            vertices.Add(pair.Key.position);
            CubeMeshData.DataCoordinate coord = CubeMeshData.offsets((int)pair.Key.normal);
            normals.Add(new Vector3(coord.x, coord.y, coord.z));

            Vector3 uv = CubeMeshData.ProjectPositionToUV(pair.Key.position, pair.Key.normal);
            uv.z = pair.Key.cubeType;
            uvs.Add(uv);
        }
    }

Hash:

 struct VertexSignature
    {
        public Vector3 position;
        public Direction normal;
        public int cubeType;

        public override int GetHashCode()
        {
            uint h = 0x811c9dc5;
            h = (h ^ (uint)position.x) * 0x01000193;
            h = (h ^ (uint)position.y) * 0x01000193;
            h = (h ^ (uint)position.z) * 0x01000193;
            h = (h ^ (uint)normal) * 0x01000193;
            h = (h ^ (uint)cubeType) * 0x01000193;

            return (int)h;
        }
    };

Then I do this:

    Vector3() vertexArr = vertices.ToArray();
    int() triArr = triangles.ToArray();
    Vector3() normalsArr = normals.ToArray();

I'm really running out of ideas on how to further improve performance.

Any help is welcome.

SharePoint Designer workflow – Pending field modification help

I am fairly new to SharePoint and am having trouble creating a fully functional workflow for some work in SP Designer and I was hoping someone could find a solution?

Basically, the process should take place as follows:

A staff member uploads a document to a document library.

The document should then be marked as "approved", "rejected" or "returned" after being reviewed by an administrative staff committee.

(There is a data column with these 3 status options configured as a drop-down list when editing document properties which will allow an administrator to change the status.)

Depending on whether the document has been approved, rejected or returned, it will be copied to one of the 3 different folders (approved) (rejected) (returned), then deleted from the original folder.

On SPD, I created a workflow that looks like this:
enter description of image here
Currently, this works fine using the Wait for field change action, but ONLY if the status is Approved.

I can't figure out how to add an OR statement or execute this action in parallel with another one but for statuses rejected or referred? Adding another step does not work because the workflow only progresses if the document is approved according to the first step.

How can I modify this workflow so that IF the selected state is Rejected or Referred, the document can be copied to its associated folder as with Approved?

javascript – modification of the component of the loaded page according to the link clicked in the sidebar

I am doing my first PWA in reaction and while I have been working in reaction before trying to do things a little more neatly and in a modular fashion.

Currently, I have a main page that has a sidebar with links, then a main page that shows the title (link name) at the top, then some maps in a content component.

All this is good so far, and if I click on the dashboard link in the sidebar, the title status changes on the main page to display the dashboard. The same goes for the trend link. However, my problem is that when I click on it, I also want to change the content of the page as well as the title at the top.

Currently my App.js is just showing the COntentComponent.js component in the body. How can I implement a change so that if I click on "Dashboard", it loads ContentCOmponent.js but if I click on "Trends", then I could load something else like TrendsCOmponent.js?

App.js

class App extends React.Component {

    state = { selectedItem: 'Dashboard' };

    componentDidMount() {
        window.addEventListener('resize', this.resize);
    }

    componentWillUnmount() {
        window.removeEventListener('resize', this.resize);
    }

    resize = () => this.forceUpdate();

    render() {
        const { selectedItem } = this.state;
        return (
            
                 this.setState({ selectedItem })} />
                
                    
                    
); } } export default App;

SidebarComponent.js

class SidebarComponent extends React.Component {

    state = { expanded: false };

    onItemClicked = (item) => {
        this.setState({ expanded: false });
        return this.props.onChange(item);
    }

    isMobile = () => window.innerWidth <= 768;

    toggleMenu = () => this.setState(prevState => ({ expanded: !prevState.expanded }));

    renderBurger = () => {
        return 
} render() { const { expanded } = this.state; const isMobile = this.isMobile(); return (
{(isMobile && !expanded) && this.renderBurger()} this.onItemClicked('Dashboard')} active={this.props.selectedItem === 'Dashboard'} /> this.onItemClicked('Trends')} active={this.props.selectedItem === 'Trends'} /> {isMobile && expanded &&
}
); }; } export default SidebarComponent;

ContentComponent.js

function ContentComponent() {
return (
    
        
            
                
                
            
            
                
                
            
        
        
);

}

export ContentComponent by default;