built in symbols – What could go wrong in redefining Power to act on functions?

Inspired by a tweet (from a locked account, unfortunately, so I can’t link it), we can get notation like $cos^2(x)$ to work in Mathematica in general:

Unprotect(Power);
Power(f_, n_)(x___) := Power(f(x), n);
Protect(Power)

Weirdly, so far, I can’t think of anything this would break, since—as far as I can tell—Power(f_, n_) is never otherwise expected to appear as the head of some other expression. It seems like this might actually be a convenient choice.

Is there any chaos this could cause that I’m not thinking of?

c – MPLAB IDE shows countless error symbols and does not work

I cant post the full code but I wish I could as there are symbols on almost every single line with any variables, that show errors with identifiers saying “Unable to resolve identifier”, which doesn’t necessarily affect the code, but makes it hard for me to troubleshoot.

if (PORTAbits.RA0 = 0 && PORTAbits.RA1 = 0 && PORTAbits.RA2 = 0)
{
 while(1){
 LATBbits.RB6 = 1;
 delay (SHORT_DELAY);
 LATBbits.RB6 = 0;
 delay (SHORT_DELAY);
                
    }
}

if (PORTAbits.RA2 = 1)
{
 while (1){   
      
 LATB = one;
 delay (SHORT_DELAY);
 
 LATB = zero;
 delay (SHORT_DELAY);
 
 x=1;
 }
 }

if (PORTAbits.RA0 = 1)
{
 while (1){   
 LATB = zero;
 delay (SHORT_DELAY);
 
 LATB = one;
 delay (SHORT_DELAY);
 
 LATB = two;
 delay (SHORT_DELAY);
 
 
 x=1;
 }
 }

Word replacement between symbols

I have a translation file that looks like this:

Apple=Apfel
Banana=Banane
Cherry=Kirsche
Train=Zug

…500+ more lines like that

now I have a file I need to work on with text. Only certain parts of text needs to be replaced, example:

The ((Apple)) was next to the ((Banana)). Meanwhile the ((Cherry)) was chilling by the ((Train)).

Result needs to be

The ((Apfel)) was next to the ((Banane)). Meanwhile the ((Kirsche)) was chilling by the ((Zug)).

There are way too many incident to copy/paste manually. What is an easy way to search for ((XXX)) and replace from another file as mentioned? I tested

import re
separators = "=", "n"

def custom_split(sepr_list, str_to_split):
    # create regular expression dynamically
    regular_exp = '|'.join(map(re.escape, sepr_list))
    return re.split(regular_exp, str_to_split)

with open('D:/_working/paired-search-replace.txt') as f:
    for l in f:
        s = custom_split(separators, l)
        editor.replace(s(0), s(1))

But it also replaces unwanted stuff e.g. ((File:Apple.png)) with ((File:Apfel.png)) and that’s not supposed to happen.

symbols – What does it mean by: `(a | z) [Element] Reals && -3 + a + z

The following very simple code

Resolve(Exists({x}, x == 3 &&  a + z < x ))

gives the result

(a | z) (Element) Reals && -3 + a + z < 0

What is the meaning of (a|z) in this context? I could not understand the documentation on Alternatives. Is it equivalent to the statement that $a, zinmathbb R$?

nondeterminism – Regular Expression and NFA: each block of five consecutive symbols contains at least two 0’s

Consider the alphabet {0, 1}. How do I find the regular expression for the set of all strings such that each block of five consecutive symbols contains at least two 0’s?

Here, by block I mean a given set of concurrent substrings. For example, for a string “0011010”, the first five characters are “00110”, which satisfies the above condition. The next block leaves out only the first character of the given string, giving me “01101”, which again satisfies the condition.

I also need help in converting the regular expression into an NFA.

keyboard – Stop autocorrect in Microsoft Office changing custom symbols to emoji

I have set up a number of custom shortcuts for math/logic symbols to use in Word and OneNote, including the left/right arrow ↔. This works in OneNote, but I also need it to work in Word, but it keeps autocorrecting to the corresponding arrow emoji which is incredibly frustrating.

I have tried the following:

  • changing the shortcut to add a space after the ↔. This still corrects to the emoji.
  • selecting “change back to (custom shortcut)” – this does what it says, and corrects it all the way back to the shortcut, rather than to the arrow symbol I want
  • using the inbuilt shortcut leftrightarrow (which I want to avoid because it’s so much faster to type a three-character shortcut than that) also autocorrects to the emoji outside of math fields in Word
  • changing the shortcut trigger to something different. This still replaces the arrow with an emoji.

Within specified math fields, this issue doesn’t occur, but I want to be able to continue to use these symbols outside of math fields, because that’s the only way I can still use it within OneNote as well due to the way the Autocorrect dictionary for Office is set up.

I suspect that the issue is due to the fact that there is an inbuilt auto-replacement function for the arrow symbol to be replaced by the arrow emoji itself, much like how the smiley symbols started getting replaced by emoji a few years ago too, but I wouldn’t know where to look to disable that to allow insertion of the actual arrow symbol itself. Any suggestions? Right now I’m copying and pasting but obviously this is not an ideal solution.

I am using Microsoft Word for Mac Version 16.46.

Thank you in advance, this is driving me up the wall!

machine learning – How to interpret symbols ∇ Del?

I have the following context


Let $w = (w_1, w_2)^T$

Consider $g(w) = 2w_1w_2 + w_2cos(w_1)$

Q: Compute $nabla_w g(w)$ and verify $nabla_w g((pi,1)) = (2, pi – 1)^T$


I’m learning machine learning, but I don’t have a lot of advanced mathematics knowledge, how to interpret the symbols $nabla_w$ in the context?

c++ – Undefined symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

actualmente estoy en MacOS BigSur, usando Visual Studio Code.

Tengo esta clase llamada main.cpp

#include <iostream>
#include "Intercambio.h"

using namespace std;

int main()
{
    int a = 1, b = 2;

    cout << a << endl;
    cout << b << endl;

    Intercambio(1,2);

    cout << a << endl;
    cout << b << endl;

    return 0;
}

Tengo este archivo de cabecera llamado Intercambio.h

void Intercambio(int a, int b);

y tengo otro archivo llamado Intercambio.cpp

void Intercambio(int a, int b)
{
    int aux;
    aux = a;
    a = b;
    b = aux;
}

Pero cuando compilo me aparece este error:

Undefined symbols for architecture x86_64:
“Intercambio(int, int)”, referenced from:
_main in main-1bda5d.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Que puedo hacer, porfavor necesito ayuda :c

posts – Posting an article containing mathematical symbols and R code

I have been trying to figure out the best workflow to publish articles heavy in R code and R output and mathematical formulas.
I would like to be able to finish the entire report in RMarkdown including all the figures (ggplot), code and tables (kable). So far I tried to copy the html code from RStudio and pasted it directly into the text editor of WordPress. When doing that I get the following errors:

  1. Basically everything that is in the <head> tag in the html file will offset the beginning my article by a certain margin. You can not see the code but I can see extra whitespace added at the beginning. The rest is displayed normally.
  2. I noticed that tables produced with kable() cannot be displayed. What could be the reason? Is there an alternative?

I imagine what I could do is to generate my tables in html and define my own styling options. This process still does not appear very streamlined to me. I would love to hear what ideas you have.

Strange signs and symbols in my sharepoint list

i have 2 strange things i have noticed when using my sharepoint list:
Could anyone tell me what these signs and symbols are:

enter image description here

enter image description here