Replace in a Symbolic Derivative doesnt work with Pi/2

I was writing some small functions for GR applications, and I was defining a Function that gives me the Geodesic equations. When testing if those worked with the Schwarzschild Metric I came upon a problem when trying to replace the angle $ \theta$ with $ \frac{\pi}{2}$ this then didn’t properly simplify it when there are derivatives of $ \theta$ .

I have made a simple example to showcase what my problem is:

Sum[D[xx[[i]][\[Tau]], \[Tau]], {i, 4}] /. t -> Pi/2 

This produces the following output:

$ \left(\frac{\pi }{2}\right)'(\tau )+x'(\tau )+y'(\tau )+z'(\tau )$

What can I do to either prevent this from happening or resolve this issue?

Gameobject doesn’t move when hits wall

I have a gameobject that moves tile based(It moves 1 unity unit continously when I press button) But when ıt hits a wall, ıt doesn’t move anymore

enter image description here

As you see, When It hits a wall, ıt doesn’t move any direction anymore. Actually I found the problem but I couldn’t find how to solve. The main problem is when cube hits wall, the distance between nextPosition and transform.position never will be <0.0005f But Idk how to solve this.

Those are code that moves cube :

void MovePlayer() {     rb.MovePosition(Vector3.MoveTowards(transform.position, nextPosition, speed * Time.deltaTime));      if (Input.GetKeyDown(KeyCode.W))     {         direction = Vector3.forward;     }      if (Input.GetKeyDown(KeyCode.S))     {         direction = Vector3.back;     }      if (Input.GetKeyDown(KeyCode.A))     {         direction = Vector3.left;     }      if (Input.GetKeyDown(KeyCode.D))     {         direction = Vector3.right;     }      if (Vector3.Distance(transform.position, nextPosition) < 0.0005f)     {         nextPosition = transform.position + direction;     } } 

`Graphics3D` doesn’t appear

I think that z values are very closed to each other. So, Graphics3D doesn’t appear.

list={{{-5, -5, 0.126912}, {-5, -4, 0.128462}, {-5, -3, 0.130012}, {-5, -2,     0.131561}, {-5, -1, 0.13311}, {-5, 0, 0.134657}, {-5, 1,     0.136204}, {-5, 2, 0.137748}, {-5, 3, 0.139292}, {-5, 4,     0.140834}, {-5, 5, 0.142373}}, {{-4, -5, 0.162526}, {-4, -4,     0.164015}, {-4, -3, 0.165499}, {-4, -2, 0.166978}, {-4, -1,     0.168451}, {-4, 0, 0.169918}, {-4, 1, 0.171379}, {-4, 2,     0.172833}, {-4, 3, 0.174281}, {-4, 4, 0.175723}, {-4, 5,     0.177157}}, {{-3, -5, 0.195412}, {-3, -4, 0.196719}, {-3, -3,     0.198017}, {-3, -2, 0.199303}, {-3, -1, 0.200579}, {-3, 0,     0.201842}, {-3, 1, 0.203095}, {-3, 2, 0.204335}, {-3, 3,     0.205564}, {-3, 4, 0.20678}, {-3, 5, 0.207984}}, {{-2, -5,     0.222664}, {-2, -4, 0.223665}, {-2, -3, 0.224649}, {-2, -2,     0.225618}, {-2, -1, 0.22657}, {-2, 0, 0.227506}, {-2, 1,     0.228425}, {-2, 2, 0.229327}, {-2, 3, 0.230212}, {-2, 4,     0.23108}, {-2, 5, 0.23193}}, {{-1, -5, 0.241484}, {-1, -4,     0.242067}, {-1, -3, 0.242631}, {-1, -2, 0.243174}, {-1, -1,     0.243698}, {-1, 0, 0.244201}, {-1, 1, 0.244684}, {-1, 2,     0.245147}, {-1, 3, 0.245589}, {-1, 4, 0.24601}, {-1, 5,     0.246411}}, {{0, -5, 0.24973}, {0, -4, 0.249827}, {0, -3,     0.249903}, {0, -2, 0.249957}, {0, -1, 0.249989}, {0, 0, 0.25}, {0,     1, 0.249989}, {0, 2, 0.249957}, {0, 3, 0.249903}, {0, 4,     0.249827}, {0, 5, 0.24973}}, {{1, -5, 0.246411}, {1, -4,     0.24601}, {1, -3, 0.245589}, {1, -2, 0.245147}, {1, -1,     0.244684}, {1, 0, 0.244201}, {1, 1, 0.243698}, {1, 2,     0.243174}, {1, 3, 0.242631}, {1, 4, 0.242067}, {1, 5,     0.241484}}, {{2, -5, 0.23193}, {2, -4, 0.23108}, {2, -3,     0.230212}, {2, -2, 0.229327}, {2, -1, 0.228425}, {2, 0,     0.227506}, {2, 1, 0.22657}, {2, 2, 0.225618}, {2, 3, 0.224649}, {2,     4, 0.223665}, {2, 5, 0.222664}}, {{3, -5, 0.207984}, {3, -4,     0.20678}, {3, -3, 0.205564}, {3, -2, 0.204335}, {3, -1,     0.203095}, {3, 0, 0.201842}, {3, 1, 0.200579}, {3, 2,     0.199303}, {3, 3, 0.198017}, {3, 4, 0.196719}, {3, 5,     0.195412}}, {{4, -5, 0.177157}, {4, -4, 0.175723}, {4, -3,     0.174281}, {4, -2, 0.172833}, {4, -1, 0.171379}, {4, 0,     0.169918}, {4, 1, 0.168451}, {4, 2, 0.166978}, {4, 3,     0.165499}, {4, 4, 0.164015}, {4, 5, 0.162526}}, {{5, -5,     0.142373}, {5, -4, 0.140834}, {5, -3, 0.139292}, {5, -2,     0.137748}, {5, -1, 0.136204}, {5, 0, 0.134657}, {5, 1,     0.13311}, {5, 2, 0.131561}, {5, 3, 0.130012}, {5, 4, 0.128462}, {5,     5, 0.126912}}};     list1 = Flatten[list, 1]; symbols[{x_, y_, z_}] := {Red, Text["\[FivePointedStar]", {x, y, z}]} Graphics3D[Map[symbols, list1]] 

OptionValue doesn’t work if a local variable has the same name as the function itself

The following innocent-looking code results in error.

Options[add] = {number -> 1}; add[x_, OptionsPattern[]] := Module[{add},    x + OptionValue[number] ]; add[1] 

The error is

OptionValue::optnf: Option name number not found in defaults for add$  2832. 

What triggers the error is the fact that a local variable declared by Module has the same name as the function, add. (For simplicity, I’ve shown an example where this local variable isn’t actually used in the code, but this doesn’t make a difference.)

Is this a bug in Mathematica, or some known quirk of OptionValue[]?

Rerender core Templates with with ToggleControl but it doesnt recognize block type

Hey Guys I want to change my const TEMPLATE = [template] dynamically with the <InnerBlocks template={TEMPLATE} /> component. Based on a toggle I want to remove my ‘core/image’ block. I tried to create this with state and I set the state of my template and columns when I toggle them. Gutenberg gives a blocktype ‘r’ not recognized error.

My index.js file of the block can be found in here

const { __ } = wp.i18n; import './styles/editor.scss' import './styles/style.scss' import edit from './edit'; import save from './save';  /**  * Register block  */  export const name = 'toolbox/three-cta';  export const settings = {     title: __("Three CTA Block"),     description: __("Display CTA block"),     category: "widget",     icon: "awards",     attributes: {         paragraph: {             type: 'string',             default: '',             source: 'html',             selector: 'p'         },         heading: {             type: 'string',             source: 'html',             selector: 'h2'         },         cards: {             type: 'number',             default: 0,         },         toggleImg: {             type: 'boolean',             default: false,         }     },     edit,     save, }  

And in edit.js these attributes gets changed. I think it has something to do with the core blocks I might be setting. But I didnt change the names of these core blocks, so I dont understand why Gutenberg doesnt recognize it.

import { InnerBlocks, InspectorControls } from "@wordpress/block-editor"; import { __ } from "@wordpress/i18n"; import { PanelBody, PanelRow, RangeControl, ToggleControl } from "@wordpress/components"; import { useDispatch, useSelect } from "@wordpress/data"; import { createBlock } from "@wordpress/blocks"; import { useState } from "@wordpress/element"; const { times } = lodash;   // const TEMPLATE = [ // The template that should be reproduced. Based on the toggle  [ "core/image", {} ], should be removed //  [ 'core/heading', { placeholder: 'Three CTA Block' } ], //  [ 'core/columns', {}, [ //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ], //      ] //      ], //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ], //      ] //      ], //      [ 'core/column', {}, [ //          [ "core/image", {} ], //          [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ], //          [ "core/paragraph", { placeholder: "CTA Description" } ], //          [ "core/button", { placeholder: "Call to Action" } ] //      ] //      ], //  ] //  ] ];  export default function edit( props ) {     const { className, attributes, setAttributes, clientId } = props;      // code for the rangeControl Innerblocks doesnt affect the code (if not clicked on the rangeControls)     const { replaceInnerBlocks } = useDispatch( "core/block-editor" );     let { inner_blocks } = useSelect( select => ( {         inner_blocks: select( "core/block-editor" ).getBlocks( clientId )     } ) );      let [column, setColumn] = useState([ 'core/column', {}, [         [ "core/heading", { placeholder: __( "PLACEHOLDER" ) } ],         [ "core/paragraph", { placeholder: "CTA P" } ],         [ "core/button", { placeholder: "CTA Button" } ],     ]])       const [template, setTemplate] = useState([         ["core/heading", { placeholder: "Three CTA Block" }],         ["core/columns", {}, [...column]],     ])        const toggleChange = (value) => {         setAttributes({ toggleImg: value })         // const newColumn = column += ['core/column', {}, [["core/image", {}],]];         const newColumn = [ 'core/column', {}, [             [ "core/image", {} ],             [ "core/heading", { placeholder: __( "Toolbox CTA" ) } ],             [ "core/paragraph", { placeholder: "CTA Description" } ],             [ "core/button", { placeholder: "Call to Action" } ],         ]]          setColumn(newColumn);         setTemplate([             ["core/heading", { placeholder: "Three CTA Block" }],             ["core/columns", {}, [...newColumn]],         ])      }      const getInspector = () => {         return (                 <InspectorControls>                     <PanelBody                             title="Add columns"                             initalOpen={true}                     >                         <PanelRow>                             <RangeControl                                     label="columns"                                     value={attributes.cards}                                     min={0}                                     max={3}                                     onChange={count => {                                         let new_innerblocks = inner_blocks                                         if ( attributes.cards < count ) {                                             new_innerblocks = [                                                 ...inner_blocks,                                                 ...times( count - attributes.cards, () =>                                                         createBlock( "toolbox/three-cta" )                                                 )                                             ];                                         } else if ( attributes.cards > count ) {                                             inner_blocks = inner_blocks.slice( 0, count )                                         }                                         replaceInnerBlocks( clientId, new_innerblocks, false );                                     }}                             />                         </PanelRow>                         <PanelRow>                             <ToggleControl                                     label="Toggle me"                                     checked={attributes.toggleImg}                                     onChange={(value) => toggleChange(value)}                             />                         </PanelRow>                     </PanelBody>                 </InspectorControls>         )     }      return (             <>                 {getInspector()}                 <div className={className}>                     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.6.3/dist/css/foundation.min.css" integrity="sha256-ogmFxjqiTMnZhxCqVmcqTvjfe1Y/ec4WaRj/aQPvn+I=" crossOrigin="anonymous"/>                     <div className="grid-x">                         <div className="cell small-12">                             <InnerBlocks template={template} templateLock="true"/>                         </div>                     </div>                 </div>             </>     ); } 

How to compute the max/min surface area of a donut-shape solid generated by a revolved 2D circle, as the volume of the solid doesn’t change?

A donut shape solid is generated by revolving a circle $ (x-a)^2+y^2=b^2$ around the y-axis. $ a$ is the distance from the center of the hole of the donut to the center of the circle revolved, and $ b$ is the radius of the circle revolved. I’m trying to compute the minimized surface area and the maximized surface area (if the solid has) with the value of $ a$ and $ b$ , while the volume of the solid doesn’t change (which is $ 90\pi^2$ ). Thanks a lot if someone can help me 🙂

Post name permalink doesn’t work

I changed the permalink structure of my site from default to postname, but this does not work: trying to access a post returns me the error 404.

Then I tried to try other types of permalinks, and everyone worked (except /%postname%/, of course). So I tried to create a custom permalink: /index.php/%postname%/. This works and I can not understand why.

I tried to change the theme and to set the structure postname and everything works perfectly. From what can be due to the error?

This is my .htaccess file:

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress

I also have Module rewrite already enabled and

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted

Still doesn’t work, any ideea?

WordPress doesn’t send a notification email when submitting a comment using REST API

When I submit a comment on the WordPress website, it sends me a notification email.
but when I submit a comment through REST API, WordPress doesn’t send me a notification email.
What should I do to make WordPress send a notification email when I submit a comment with REST API?