C++: Allocate two arrays of same size but different types in a single allocation

Does the standard library offer a way to allocate two arrays of different member types, but with the same size in a single allocation?

I am trying to figure out a solution that

  • doesn’t require calculating the overall size manually while respecting alignment requirements,
  • ideally has memory management covered, i.e. doesn’t require freeing memory manually.
  • compiles with clang and MSVC (ideally portable :-))

Essentially, something like

    struct {
        A as(n);
        B bs(n);
    } arrays;

Where n is dynamic.

custom post types – restrict content for users with same role

I have created a custom post type (CPT) called “books” where users will be able to exchange “bookid” and “bookinfo” (as ACF).

I have created user roles such as Countries and cities (France> Paris, France>Marseille)

I am looking to find a way that a user who has the user role Paris can only “view/edit/delete” the books from all users from same user role (Paris)

I am also looking to find a way that a user who has the user role France will be able to “view/edit/delete” the books from all sub user roles such as Paris and Marseille.

I hope my idea is quite clear…
I havent found any plugin who could do that or any function after hours of research online.
any idea ?

custom post types – Limit Comment WordPress

Following is my code which I am using to display comments of posts in a loop (Custom Post Types). I would like to display only latest 3 comments. Kindly help me to limit comments.

<?php  foreach (get_comments() as $comment): ?>
                                <div><span class="author-name"><?php echo $comment->comment_author; ?> said:</span> <span class="author-cmnt">"<?php echo $comment->comment_content; ?>".</span></div>
                                <?php endforeach; ?>

Identifying types of web animation

I’m looking for a way to identify the types of web animation. For example I’d like to know how to understand which type of animation is this (flash or something else).

custom post types – How to get rewrited name of cusom taxonomy?

I have registered custom post taxonomy with rewrited name:

register_taxonomy('behold_gallery-albums-subject', 'behold_gallery',array(
    'hierarchical'              => true,
    'labels'                    => $labels,
    'show_ui'                   => true,
    'show_admin_column'         => true,
    'rewrite'                   => array( 'slug' => 'kategorie-galerii', 'with_front' => true ),
    'update_count_callback'     => '_update_post_term_count',
    'query_var'                 => true,
));

so name of my custom taxonomy is ‘behold_gallery-albums-subject’ but is rewrited to ‘kategorie-galerii’.

If I want to get name of this taxonomy, I can use this

$postsTaxonomy = get_sub_field('archive__post-choose-taxonomy'); // ACF
$postsTerm = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); 
$postsTerm_id = $postsTerm->term_id;
$PostsTaxName = get_taxonomy($postsTaxonomy)->labels->name;

but how can I get this rewrited name, not the ‘original’?

Thanks!

Button per line in Custom Post Types

Since several hours ago I am trying to solve this issue but I don’t know what I am doing wrong in the code.

I have a Custom Post Type with several records, then I wrote a php script to show the content as a table:

Query Table

At the end of each row there is a button, the idea is to pass the row’s POST_ID value to other form and php script. However, after you click this button, it opens a new tab with the URL including the name of the site and Post_id value like https://telework/wp-admin/admin.php?Id=2749&submit_btn=Pagar.

The button’s code is:

<td> <form type="post"><input type="hidden" name="Id" value="<?php echo $post_id; ?>"><input type="submit" name="submit_btn" value="Pagar"></form></td>

I’ve tried to insert action=”process.php” inside <form>, then change the type=”post” to method=”post” but gives me error 500.
How and where can I include the code to open the new form and php script?
Thank you for your help and have a good day.

Marcelo

How to change file types in Google Drive?

I have 2 files in My Drive with ipynb extension.
One is marked as Unknown file type and has a blue icon, and the other is marked as Colaboratory type.

How do I change both to be Colaboratory?

one_file_unknown_one_colab

typescript – Typescrip no react, instalação com @types

Estou querendo instalar uma biblioteca que insere um input do estilo time, na seguinte instalação

npm install react-time-picker

E para instalar o typescript seria o

npm install @types/react-time-picker

So que da o seguinte erro

npm ERR! 404 Not Found – GET https://registry.npmjs.org/@types%2freact-time-picker – Not found
npm ERR! 404
npm ERR! 404 ‘@types/react-time-picker@latest’ is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Pelo que entendi isso significa que não existe o types dessa biblioteca?
Se sim, existe alguma solução?

What Are The Types Of Link Building?