Changed permalink structure. Need help with redirecting old posts

I just changed the urls structure of my site and want old urls to be forward to the new without the use of redirection plugin.

Old structure: /%category%/%year%/%day%/%postname%/

New: /%postname%/

Can anyone you tell me the regix code for the redirect than I can insert in the .htaccess file? Thanks.

P.S. I tried yoast code regenerator and and it redirected the old urls to the new urls without the end trailing slash and then redirected again with the trailing slash. So, it generated 2 redirect chains instead of one.

I am not able to figure out the .htaccess code needed and the Yoast permalink generator code RedirectMatch 301 ^/([^/]+)/([0-9]{4})/([0-9]{2})/([^/]+)/$ https://www.website.com/$ 4 seems to cause redirect chain issue.

I would like to know how to correct this code RedirectMatch 301 ^/([^/]+)/([0-9]{4})/([0-9]{2})/([^/]+)/$ https://www.website.com/$ 4 so I can insert in my htaccess file. Thanks.

Need help with my risk game program – i need to insert 2 players, throw x number of dices, order them and confront the results of the 2 players

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Text;

namespace ConsoleApp8 { class Program { static List names; static List dices; // [2, 3] static List player1Dices = new List(); static List player2Dices = new List();

    static List<string> PromptNames()     {         Console.Write("Nome del primo giocatore: ");         string player1 = Console.ReadLine();         Console.Write("Nome del secondo giocatore: ");         string player2 = Console.ReadLine();          List<string> names = new List<string>();          names.Add(player1);         names.Add(player2);         return names;     }      static int GetDieValue(string x, string msg)     {         Console.Write("{0}, {1} ", x, msg);         string rawDie = Console.ReadLine();         int parsedDie;         // qui devi usare do, while perché non sai a priori quante volte un giocatore potrebbe inserire un valore sbagliato         if (!Int32.TryParse(rawDie, out parsedDie))         {             Console.WriteLine("Meti un numero");             return GetDieValue(x, msg);         }         return parsedDie;     }      static List<int> PromptDices()     {         int p1Dices = GetDieValue(names[0], "con quanti dadi vuoi attaccare?");         int p2Dices = GetDieValue(names[1], "con quanti dadi ti vuoi difendere?");          return new List<int>() { p1Dices, p2Dices };     }     static void Play()     {         Console.WriteLine("{0} attacca con {1} dadi", names[0], dices[0]);         Console.WriteLine("{0} difende con {1} dadi", names[1], dices[1]);         CalculateResult();      }     static void CalculateResult()     {         System.Random random = new System.Random();         for (int i = 0; i <= dices.Count; i++)         {             player1Dices.Add(random.Next(1, 7));         }         Console.WriteLine("Prima: {0}{1}{2}", player1Dices[0], player1Dices[1], player1Dices[2]);         player1Dices = player1Dices.OrderByDescending(x => x).ToList();         Console.WriteLine("Dopo: {0}{1}{2}", player1Dices[0], player1Dices[1], player1Dices[2]);           for (int i = 0; i <= dices.Count; i++)         {             player2Dices.Add(random.Next(1, 7));         }         Console.WriteLine("Prima: {0}{1}{2}", player2Dices[0], player2Dices[1], player2Dices[2]);         player2Dices = player2Dices.OrderByDescending(x => x).ToList();         Console.WriteLine("Dopo: {0}{1}{2}", player2Dices[0], player2Dices[1], player2Dices[2]);      }         private static void PlayAgain(string x)     {         Console.WriteLine("Se vuoi finire il gioco scrivi Exit");         string Exit = x;         do         {             RunGame();             player1Dices.Clear();             player2Dices.Clear();         }         while (x != Console.ReadLine());                }      static void RunGame()     {         names = PromptNames();         dices = PromptDices();         CalculateResult();         Play();         PlayAgain();                          // generate random numbers - and sort them         // display results - compare dices         // repeat or quit?     }      private static void PlayAgain()     {         throw new NotImplementedException();     }      static void Main(string[] args)     {         RunGame();         Console.WriteLine("Thanks for playing");         Console.ReadKey();     } } 

}

Western Union…please help :(

I used Western Union to send money for a purchase I made. I got my MTCN from them, and I called their number and dialed the MTCN when asked. I just checked the status of my transfer on their website and got a message saying

"W0131 We do not have an order with the provided information. Please verify your information and click Check Status."

I typed the EXACT number I was given, but I still get this message. Does it take a certain amount of time until the system recognizes your MTCN or…

Western Union…please help :(

Help with Elementor Pagination archive 404 problem

The pagination links in CPT archive created with Elementor Pro get a 404.

I’ve spend a full day searching and trying everything I found on Google with search "CPT Elementor archive pagination 404": readjust posts per page in write settings, tweak Function.php, tweak cpt php (in my case as a custom made plugin , see herafter) and some other… none resulting in a partial or full solution.

Example of page resulting in 404 is here: https://developer.mkorke.net/guide-voyage-chili-argentine/voyage-atacama/page/2/ (access with admin/admin). The standard archive pagination links work perfectly (https://developer.mkorke.net/guide-voyage-chili-argentine/). This is test site, same happens on proper website.

This is driving me crazy. I’m doing my best with the beginner knowledge I have. Please help.

    add_action('init', 'CT_temoignage');     function CT_temoignage()     {         register_post_type('post-temoignage', array(          'label' => __('Témoignages'),          'singular_label' => __('Témoignage'),          'public' => true,          'has_archive' => true,          'show_ui' => true,          'capability_type' => 'post',          'hierarchical' => false,          'taxonomies'=> array ('category', 'post_tag'),          'supports' => array('title', 'author', 'editor', 'thumbnail','excerpt','revisions','page-attributes','publicize', 'wpcom-markdown'),          'menu_position'=>5, 'rewrite' => array('slug' => 'temoignages','with_front' => true),                             // 'query_var' => 'temoignage'           'publicly_queryable' => true,     'query_var' => true,     'rewrite' => false,         ));         add_theme_support( 'post-thumbnails' );                  global $  wp_rewrite; $  gallery_structure = '/temoignages/%post-temoignage%'; $  wp_rewrite->add_rewrite_tag("%post-temoignage%", '([^/]+)', "post-temoignage="); $  wp_rewrite->add_permastruct('post-temoignage', $  gallery_structure, false);     }     // Add filter to plugin init function add_filter('post_type_link', 'post_temoignage_permalink', 10, 3);     // Adapted from get_permalink function in wp-includes/link-template.php function post_temoignage_permalink($  permalink, $  post_id, $  leavename) {     $  post = get_post($  post_id);     $  rewritecode = array(         '%year%',         '%monthnum%',         '%day%',         '%hour%',         '%minute%',         '%second%',         $  leavename? '' : '%postname%',         '%post_id%',         '%category%',         '%author%',         $  leavename? '' : '%pagename%',     );       if ( '' != $  permalink && !in_array($  post->post_status, array('draft', 'pending', 'auto-draft')) ) {         $  unixtime = strtotime($  post->post_date);               $  category = '';         if ( strpos($  permalink, '%category%') !== false ) {             $  cats = get_the_category($  post->ID);             if ( $  cats ) {                 usort($  cats, '_usort_terms_by_ID'); // order by ID                 $  category = $  cats[0]->slug;                 if ( $  parent = $  cats[0]->parent )                     $  category = get_category_parents($  parent, false, '/', true) . $  category;             }             // show default category in permalinks, without             // having to assign it explicitly             if ( empty($  category) ) {                 $  default_category = get_category( get_option( 'default_category' ) );                 $  category = is_wp_error( $  default_category ) ? '' : $  default_category->slug;             }         }         $  author = '';         if ( strpos($  permalink, '%author%') !== false ) {             $  authordata = get_userdata($  post->post_author);             $  author = $  authordata->user_nicename;         }         $  date = explode(" ",date('Y m d H i s', $  unixtime));         $  rewritereplace =         array(             $  date[0],             $  date[1],             $  date[2],             $  date[3],             $  date[4],             $  date[5],             $  post->post_name,             $  post->ID,             $  category,             $  author,             $  post->post_name,         );         $  permalink = str_replace($  rewritecode, $  rewritereplace, $  permalink);     } else { // if they're not using the fancy permalink option     }     return $  permalink; }    ?> 

I want to change this matlab code to Mathematica? can you help me

my code have one matrix entry and works as QR decompose method by using Givens rotation and its outputs contain 2 matrix as Q and R I want to run this code in mathematica without using Matlink package…..can you help me by rewriting this code in mathematica Language eye is the IdentityMatrix and norm(a,b) is $ \sqrt{(a^2+b^2)}$ Thank you for HELP

function [Q,R] = my_givens_QR(A) n = size(A,1);  Q=eye(n); R=A; for j=1:n for i=n:(-1):j+1 x=R(:,j); if norm([x(i-1),x(i)])>0 c=x(i-1)/norm([x(i-1),x(i)]); s=-x(i)/norm([x(i-1),x(i)]); G=eye(n); G([i-1,i],[i-1,i])=[c,s;-s,c]; R=G'*R; Q=Q*G; end end end 

Help me Make Sense of Unity 2D Resolution Management

I am trying to set up an environment for a retro style pixel art game in Unity 2D. I aim for a vertical resolution of 240 pixels, and then, I would like the horizontal resolution to be dependent on the target screen’s aspect ratio, so, on a 4:3 screen 320×240, on 16:9 around ˜432×240, and so on.

I have read a bunch of tutorials, added pixel perfect to my main camera, set up a target resolution in player preferences, set the pixel in a unit to 8 pixels everywhere, but still cannot make heads or tails of how it actually works.

Here is an image of my scene with my camera selected:

enter image description here

If I am correct, the dashed line of the camera is my target resolution, although it is weird as the green image I used as a background has a native resolution of 216 pixel vertical, yet it fills up the supposedly 240 pixel high camera. I have no idea what the solid green line is, and don’t even get me started of the canvas, whose render target is set for camera yet it is obviously many times bigger than that.

Can someone please explain it to me how to properly set up a 2D environment described in my opening, point out my mistakes, point me to a good tutorial, or just give me advice on how to understand Unity’s resolution management?

Padding Inside a Floating div | Need Help

I am in the middle of creating a basic, plain jane, old school div layout. But for the life of me, I can't figure out how to get padding in the content area and side menu without the template distorting with extra padding. I've been searching online for hours — and I'm finding 'apparent' solutions, but when I try to implement them, they don't work. I now have a migraine. If anyone has a solution, I'd be rapt to know what it is.

Note: The template isn't complete, per se. I'm just trying…

Padding Inside a Floating div | Need Help