jeudi 1 juillet 2021

Excel Question on IF Nested Function. Don't know why an element is appearing in the code

While I am learning Nested Function with Excel, I encountered a question that I would like to ask.

The criteria is the following:

  1. Increase the backers_count by 5 if:
  2. The launched_at_month is January OR September
  3. The city is Vancouver AND the country_trimmed is Canada
  4. If these conditions are not met, the backers_count stays the same. The code is below:
=IF(OR(condition1,condition2), IF(AND(condition3,condition4), backers_count+5, **backers_count**), backers_count)

My question is why have another backers_count as show bold in the code given another backers_count if False in the end. I removed it for test and returned with false.

Thank you very much for your help and assist.

Prevent clicking twice before running indented if block

So I want to check if my class contains a certain class name before running my indented if statment, my problem is that I'm required to press my button twice before it runs my indented if and else statements while I just want to press it once.

my code :

    filter(e) {

        if(e.target.classList.contains(productive)){
            if (document.getElementById(productive).style.display ==="block") {
                document.getElementById(productive).style.display = "none"
                e.target.classList.add('selected');

            }
            else {
                document.getElementById(productive).style.display = "block"
                e.target.classList.remove('selected');
        }}

    }

this is how I have attached my onclick

<div id="filter_"><a className={""+main_class} style={pillStyle} onClick={this.filter}>{this.props.filter}</a></div>

In batch, is it possible to run a fc and an if %errorlevel% right after each other in a single for loop?

Basically, I am trying to write a batch file that will run an FC for all files in a directory (and its sub directory) and then run a separate batch script if an anomaly is found. Basically, the code is something like this.

(Upperpart_removed)

:main

for /f "delims=" %%F in (
Sth
) do (
    fc "folder/path ... " & if %errorlevel% NEQ 0 "C:\Users\user\command.bat"

)

if %errorlevel% EQU 0 goto main

Now the code looks a bit off because I had to redact folder paths and stuff (company security policy), but essentially every other line except for that fc ~~~ part is working. I am trying to figure out a way to run a batch file only if the errorlevel changes, and if its 0 just loop fc again. My current code ends up showing a "File not found" error but theerrorlevel remains 0 so the batch file isn't triggered. Does anyone know how to do this?

How to put together different if statements and for loops in java?

I am a beginner in programming and I need some help! I have these for-loops and if statements, how could I shorten the code?

       `for (int i = 0; i < Sentence.length(); i++) {
            if (Sentence.charAt(i) != ' ') {                                                                                          
                totalNumberOfCharaters++;
            }
        }

        for (int i = 0; i < Sentence.length(); i++) {                                                                                 
            if (Sentence.charAt(i) == symbolInput.charAt(i) ) {
                numberOfSymbols++;
            }
        }`

Convert high level to assembly [duplicate]

Please help convert this condition statement for me

If (a < b)
{
   B = c + 2;
}
 else 
{
  C = 0;
}

how to create a variable and use it later in an if statement windows forms c++

I have tried to create a variable when the user clicks a button then use an if statement inside another button inside another form to identify which button the user pressed earlier, but when I use the if statement inside another button the variable is unidentified, I have also included the other form in the code. my code inside the first form button is

private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
        int category = 1;
        this->Hide();
        MyForm3^ obj1 = gcnew MyForm3();
        obj1->ShowDialog();
    }

in the second form

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    if (category = 1) {
        MessageBox::Show("testing", "check", MessageBoxButtons::OK, MessageBoxIcon::Hand);
    }
}

it shows this error identifier "category" is undefined

PINESCRIPT: I cant put diferent values on an indicator for diferent tickers

I want to put a 10EMA on AAPL and a 50EMA on every other symbol but it keeps saying that my "len" is a series(interger) instead of an interger.

//@version=4
study(title="TEST", shorttitle="TEST", overlay=true)

var int   len = na

if barstate.isfirst
    if syminfo.ticker == "AAPL"
        len := 10
    else
        len := 50

abc=ema(close, len)

plot(abc, color=color.green)