Python is executing the functions inside my switch before I’m calling it

I’m new to stack exchange.

I am trying to implement a menu of actions to perform. I have the menu in a switch dictionary. When I run the code, it would run through the read_feature_registers first, instead of getting to the print(“MENU”) where I would eventually request for the menu input and execute the function in the switch. What am I doing wrong?

menu_switcher = {
    1: ("Readback feature registers", read_feature_registers(features_json, get_user_feature(features_json))),
    2: ("List feature registers", print_feature_registers(features_json, get_user_feature(features_json))),
    3: ("Dump all feature registers to file", dump_all_features(dump_file.log)),
    4: ("Exit", "")
}

# Menu
exit_script = 0
while(~exit_script):
    print("MENU")
...

Help greatly appreciated.

network – Mac Pro tower (2020) ethernet doesn’t work if plugged into an unmanaged switch

I’m trying to connect my Mac Pro tower (2020) to my network using ethernet but am experiencing problems if use my Netgear GS105 switch, this setup results in the MacPro saying “Cable connected but self-assigned IP”. I’ve renewed DHCP leases, changed all sorts of settings including on my router but nothing works, I have also validated that this setup does work fine with every other computer (including a MacPro Trashcan) and if I connect the MacPro Cheese-grater directly to the router it works so to recap:

This does not work:

(Router)–<cable_a>–(Switch)–<cable_b>–(MacPro2020)

This does work:

(Router)–<cable_a>–(Switch)–<cable_b>–(MacPro Trashcan)

These also work:

(Router)–<cable_a>–(MacPro2020)

(Router)–<cable_b>–(MacPro2020)

I’ve also tried different cables in place of both <cable_a> and <cable_b> and it doesn’t improve the situation, every possible combo works except if I have the MacPro 2020 Tower plugged in via the Netgear switch. Is there some issue with unmanaged switches and MacPro 2020 Towers?

Unable to switch hw keyboard language

Do I have to buy HW keyboard located to my native language in order to be able to write in my native languag ?

So far, everytime I connect HW keyboard which has natively only EN characters, I am not able to write interpunctions and any special characters of my native language, despite Android shows that my native language is choosen.

I’ve used stock (LG keyboard), gboard, swiftkey

nothing helped, once HW keyboard is connected, only English and characters which are on the keyboard physically marked, I can use.

Thank you

mobile – Flashlight switch: display the desired state or the current state

Situation:
I need to design a view in a mobile application (iOS + android) to scan qr-codes. The view needs a toggle to switch the flashlight “on” and “off”.

Problem:
I first designed the switch that represented the current state of the flashlight (V1). This means that when the flashlight is “off” the icon shows a crossed out light bulb and when the flashlight is “on” the icon shows a glowing light bulb.

enter image description here

Like toggles work in settings for example:

enter image description here

When I tested my design in a prototype (Adobe XD) is feels very strange to turn on the flashlight by clicking on an icon that shows a crossed out light bulb.

For this reason I have created another variant that shows exactly the opposite:

  • When I want to turn “on” the light, I click on the icon with the light
    “on “
  • When I want to turn “off” the light, I click on the icon with the
    light “off”.

It’s like a play and pause button on a music player

  • When I want to play the song, I click on the play icon
  • When I want to pause the song, I click on the pause icon

enter image description here
enter image description here

enter image description here

I had a discussion with a colleague about whether it makes sense to display what the user wants to achieve, or the current state. Displaying the current state makes less sense to me in this context, because the user knows that the flashlight is off when sitting in the dark. And as I said it feels weird to click on this crossed out icon. Now I am successfully confused how to solve this problem. I think it’s not good to break the switch behavior everyone is used to know, even if it feels weird to me.

What do you guys think?

How to change IFS function to switch in Google sheets?

I have this formula =ifs(OR(A1="January",$A$1="March",$A$1="May"),$A10,OR($A$1="April",$A$1="June"),$B11,OR($A$1="February"),$C10) I would like to use switch instead of IFS without repeating A1=””:

so something like this switch(A1=("January" or "March" or "May"), A10, ("April"or"June"),B10, ("February"),C10)

I know its wrong. So A1 cell is Month name that user will enter A10 , B10, C10 are values to be shown according to criteria in the formula If I use Switch, I need to repeat lot of words as well: so I expect the formula will be like this: switch(OR(A1="January",A1="March",A1="May"), A10, OR(A1"April",A1="June"),B10, "February",C10)

Any thought how not to repeat the (A1=””)? if the value equals to the criteria then

Alternar entre programas utilizando o switch C++

resumirei brevemente o problema que estou enfrentando.
Estou programando, junto ao meu grupo, o meu projeto final de C++. Pois bem, somos três e cada participante programou um fator. No entanto, precisamos entregar o código todo sem headers, e em apenas um arquivo .cpp. Para isto, resolvi utilizar SWITCH para alternar entre os programas que cada participante do grupo escreveu.
Estou o dia todo tentando perceber qual o problema, já tentei unir o código de formas diferentes, no entanto, sem sucesso. Aparentemente o SWITCH está funcionando, porém não executa até o final do laço.

O problema que estou enfrentando–>
Quando executo, por exemplo, o Case2, ele apenas me retorna “File Open With Success”. Todas as funções, saídas, e até mesmo o último CIN deste laço ele não executa.

case 2 :    //Weather System
                     {
                ifstream Ifile("Weather.dat");          //data file responsible for sotring information related to the weather   
                Ifile.open("Weather.dat");  
                
                if (Ifile.is_open())
                {
                    cout << "File open with success.";
                 }

Sendo que este case, possui o seguinte código:

   ```                  case 2 :    //Weather System
                 {
            ifstream Ifile("Weather.dat");          //data file responsible for sotring information related to the weather   
            Ifile.open("Weather.dat");  
            
            if (Ifile.is_open())
            {
                cout << "File open with success.";
             }
            while(!Ifile.eof())
{
    
    Ifile>>FileVal;
    if (FileLine==1) 
    day1.set_wind_speed(FileVal,hour);
    if (FileLine==2)
    day1.set_rainfall(FileVal,hour);
    if (FileLine==3)
    day1.set_snowfall(FileVal,hour);
    if (FileLine==4)
    day1.set_temp(FileVal,hour);
    

    if(Ifile.peek()=='n')      //Once file reaches end of line
    {
    FileLine+=1;
    StaticHour=hour;    //To save what hour it is, doesnt matter what line because all lines are same length
    hour=0;     //Sets 0 because new line with new hours
    }
    hour+=1;

}
Ifile.close();
day1.display(StaticHour);

//Exceptions throw variables in warning functions in the weather class so if there is a exception value it wont display a warning//
    try 
    {
                             day1.Check_Wind(StaticHour);
    }
    
    catch (Wind_Error E1)
    {
                            E1.Read_Error();
    }
    
    try
    {
                            day1.Check_Rain(StaticHour); 
    }
    
    catch (Rain_Error E2)
    {
                            E2.Read_Error();
    }
    
    try
    {
                            day1.Check_Snow(StaticHour);
    }
    
    catch (Snow_Error E3)
    {
                            E3.Read_Error();
    }
    
    try
    {
                            day1.Check_Temp(StaticHour);
    }
    
    catch (Temp_Error E4)
    {
                            E4.Read_Error();
    }
    
                        cout<<"If you would like to see all weather values of the day press 1 if not press any other key --> ";
                        cin>>Input;
                        if(Input==1)
                        day1.display_all(StaticHour);
                        else 
                        break;

                        } 

Estarei postando o código inteiro para uma melhor análise.

#include <fstream>
#include <sstream>
#include <exception>
// #include <bits/stdc++.h>  --> replaced for cstdlib &  ctime  for less compilation time 
#include <ctime>
#include <cstdlib>
#include <string>


using namespace std;

class stock 
{

private:
    string Symbol;
    int amount;
    double open_p;
    double close_p;
    double buy_p;

public:
    
          //FUNCTIONS
          
    stock();
    stock(string symbol, int amount, double open_p, double close_p, double buy_p)
    {
            setSymbol(symbol);
            setAmount(amount);
            setOpenP(open_p);
            setCloseP(close_p);
            setBuyP(buy_p);
    }
    virtual ~stock()
    {
        
        
    }

    string getSymbol()
    {
        return Symbol;
    }
    
    int  getVolume()
    {
            return amount;      
    }
    
    double getOpenP()
    {
            return open_p;
    }
    
    double getCloseP()
    {
            return close_p;

    }
    
    double getBuyP()
    {
            return buy_p;

    }
    
    void setSymbol(string Symbol)
    {
            this->Symbol = Symbol;

    }
    
    void setAmount(int amount)
    {
            this->amount = amount;

    }
    
    void setOpenP(double o_price)
    {
            this->open_p = open_p;

    }
    
    void setCloseP(double c_price)
    {
            this->close_p = close_p;

    }
    
    void setBuyP(double b_price)
    {
            this->buy_p = buy_p;

    }
    
    double calc_ActualHolding()
    {
        double h;
        h = (double)getVolume() * getBuyP();
        return h;
        
    }
    double calc_OpenHolding()
    {
        double h_marketopen;
        h_marketopen = (double)getVolume() * getOpenP();
        return h_marketopen;
    }
    double calc_CloseHolding()
    {
            double h_marketclose;
            h_marketclose = (double)getVolume() * getCloseP();
            return h_marketclose;
    }
            
};

class  Bank_Account : public stock
{
        public: 
            double balance;
            int Account_ID;
            
            Bank_Account()
            {
                        balance = 0.0;
                        Account_ID = 0;
    
        }
            Bank_Account(double, int)
            {
                            this->balance = balance;
                            this->Account_ID = Account_ID;
            }
            
            double get_userbalance()
            {
                return balance;     
            }
            
            int get_accountid()
            {
                return Account_ID;
            }
};


        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////
class Wind_Error : public exception
{
            public:
                         float wind_speed;
                         
    Wind_Error(float wind)
    {
    this->wind_speed=wind;
    }
    
        void Read_Error()
        {
                    cout<<"***WIND SPEED ERROR***"<<endl;
                    cout<<"The wind speed value "<<this->wind_speed<<" at the end of the first line in file is a exception/error value"<<endl;
                    cout<<"**********************"<<endl;
        }
};
        
        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////

class Rain_Error : public exception
{
            public:
                         float rainfall;
                         
        Rain_Error(float rain)
        {
        this->rainfall=rain;
        }
    
        
        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////

        
        void Read_Error()
        {
                    cout<<"***RAINFALL ERROR***"<<endl;
                    cout<<"The rainfall value "<<this->rainfall<<" at the end of the second line in file is a exception/error value"<<endl;
                    cout<<"*********************"<<endl;
        }
};
        
    
        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////

        
        
   class Snow_Error : public exception
{
        public:
                     float snowfall;
                     
    Snow_Error(float snow)
        {
        this->snowfall=snow;
        }
        
    void Read_Error()
        {
                    cout<<"***SNOWFALL ERROR***"<<endl;
                    cout<<"The snowfall value "<<this->snowfall<<" at the end of the second line in file is a exception/error value"<<endl;
                    cout<<"*********************"<<endl;
        }
};  
        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////     
        class Temp_Error : public exception
{
        public:
                float temp;
                
        Temp_Error(float temp)
        {
        this->temp=temp;
        }
        
        void Read_Error()
        {
                    cout<<"***TEMPERATURE ERROR***"<<endl;
                    cout<<"The temperature value "<<this->temp<<" at the end of the second line in file is a exception/error value"<<endl;
                    cout<<"*********************"<<endl;
        }
};
//**EXCEPTION CLASSES END**//
        ///////////////////////////##############################//////////////////////////////************************************************************/////////////////////////////////////
        ////////////////////////////############################//////////////////////////////************************************************************/////////////////////////////////////

class Weather
{
         private:
                float wind_speed(24);
                float snowfall(24);
                float rainfall(24);
                float temp(24);
public:

    storms()
        {
            
        }
//**SET FUNCTIONS**//
    void set_wind_speed(float wind_speed, int hour)
        {
        this->wind_speed(hour)=wind_speed;
        }
        
    void set_rainfall(float rainfall, int hour)
        {
        this->rainfall(hour)=rainfall;
        }
        
    void set_snowfall(float snowfall, int hour)
        {
        this->snowfall(hour)=snowfall;
        }
        
    void set_temp(float temp, int hour)
        {
        this->temp(hour)=temp;
        }
//****CHECK FUNCTIONS BEGIN****//
    bool Check_Wind(int hour) //Bool so it can return a value to leave the function and return to main
        {
            
    //**Check for exception**//
    if (this->wind_speed(hour)<0 || this->wind_speed(hour)>=500)
    {
        Wind_Error Error1(this->wind_speed(hour));
        throw Error1;
    }
            //**Blizzard Statement**//
            if  (this->wind_speed(hour) >= 56 && this->snowfall(hour)>=1)
            {
                        cout<<"****WARNING BLIZZARD****"<<endl<<"There is a blizzard happening in your area with wind speeds of "<<this->wind_speed(hour)<<"km/h and snowfall of "<<this->snowfall(hour)<<" feet"<<endl;
                        cout<<"Please Follow Safety Procautions: "<<endl;
                        cout<<"Avoid driving as roads may be slippery and vision is obscured "<<endl;
                        cout<<"Stay inside "<<endl;
                        cout<<"************************"<<endl<<endl;
            return 1;       //Return Garbage value to jump back to main
            }
            //**Warning Statement**//
            else if (this->wind_speed(hour) >= 50)
            {
                        cout<<"****WARNING HIGH WINDS****"<<endl<<"There are high winds in your area with wind speeds of "<<this->wind_speed(hour)<<"km/h"<<endl;
                        cout<<"Please Follow Safety Procautions:"<<endl;
                        cout<<"Slow down while driving "<<endl;
                        cout<<"Be wary of debris "<<endl;
                        cout<<"Stay inside"<<endl;
                        cout<<"**************************"<<endl<<endl;
            return 1;
            }
            else if (this->wind_speed(hour) != 0)
            {
                        cout<<"---Winds---";
                        cout<<"It is currently windy in your are with wind speeds of "<<this->wind_speed(hour)<<"km/h"<<endl;
                        cout<<"-----------"<<endl<<endl;
            return 1;
            }
        }       
    
    bool Check_Rain(int hour)
        {
    //**Check for exception**//
    if (this->rainfall(hour)<0 || this->rainfall(hour)>=10)
    {
    Rain_Error Error2(this->rainfall(hour));
    throw Error2;
    }
            if  (this->rainfall(hour) >= .75)
            {
                        cout<<"****WARNING HEAVY RAIN****"<<endl<<"There is Heavy Rain in your area with rainfall of "<<this->rainfall(hour)<<" inches per hour"<<endl;
                        cout<<"Please Follow Safety Procautions:"<<endl;
                        cout<<"Avoid driving or slow down while as roads may be slippery and vision is obscured"<<endl;
                        cout<<"Stay inside"<<endl;
                        cout<<"**************************"<<endl<<endl;
            return 1;
            }
            else if (this->rainfall(hour)!=0 )
            {
                        cout<<"---RAINFALL---"<<endl;
                        cout<<"It is curently raining in your area with rainfall of "<<this->rainfall(hour)<<"inches per hour"<<endl;
                        cout<<"----------"<<endl<<endl;
            return 1;
            }   
            
        }

bool Check_Snow(int hour)
    {
//**Check for exception**//
if (this->snowfall(hour)<0 || this->snowfall(hour)>=50)
{
Snow_Error Error3(this->snowfall(hour));
throw Error3;
}
        if (this->snowfall(hour)>= 1)
        {
                    cout<<"****WARNING HEAVY SNOWFALL****"<<endl<<"There is a large amount of snowfall in your area with "<<this->snowfall(hour)<<" feet of snow on the ground"<<endl;
                    cout<<"Please Follow Safety Procautions: "<<endl;
                    cout<<"Avoid driving or slow down as roads may be icy and slippery"<<endl;
                    cout<<"Wear warm and insulating clothing if going outside "<<endl;
                    cout<<"*******************************"<<endl<<endl;
        return 1;
        }
        else if (this->snowfall(hour)!=0 )
        {
                    cout<<"---SNOWFALL---"<<endl;
                    cout<<"It is curently snowing in your area with snowfall of "<<this->snowfall(hour)<<" feet"<<endl;
                    cout<<"--------------"<<endl<<endl;
        return 1;
        }
    }
    
bool Check_Temp(int hour)
    {
//**Check for exception**//
if (this->temp(hour)<-100 || this->temp(hour)>=60)
{
Temp_Error Error4(this->temp(hour));
throw Error4;
}
    if(this->temp(hour)>=25)
        {
                    cout<<"****WARNING HIGH TEMPERATURES****"<<endl<<"The temperature in your area is currently "<<this->temp(hour)<<" C"<<endl;
                    cout<<"Please Follow Safety Procautions:"<<endl;
                    cout<<"Wear light and loose clothing"<<endl<<"Do not leave children or pets in cars"<<endl<<"Wear sunscreen"<<endl<<"Find somewhere cool"<<endl;
                    cout<<"*********************************"<<endl<<endl;
        return 1;
        } 
    if(this->temp<=0)
        {
                    cout<<"****WARNING BELOW FREEZING TEMPERATURES****"<<endl<<"The temperature in your area is currently "<<this->temp(hour)<<" C"<<endl;
                    cout<<"Please Follow Safety Procautions:"<<endl;
                    cout<<"Wear warm and insulating clothing"<<endl;
                    cout<<"Be cautious while driving as roads may be icy or slippery"<<endl;
                    cout<<"*******************************************"<<endl<<endl;
        return 1;
        }
    }
    
//****CHECK FUNCTIONS END****//

    void display(int hour)
    {
        if(hour<=12)
                    cout<<"*--It is currently "<<hour<<"am"<<" and the temperature outside is "<<this->temp(hour)<<" Celcius --*"<<endl<<endl;
        else
                    cout<<"*--It is currently "<<(hour-12)<<" and the temperature outside is "<<this->temp(hour)<<" C--*"<<endl;
    }
    void display_all(int hours)
    {
              cout<<"HOURtSNOWFALLtRAINFALLtWIND SPEEDtTEMPERATURE"<<endl;//temperature 
        for(int i=1;i<=hours;i++)
        {
                        cout<<i<<"t"<<this->snowfall(i)<<"Feettt"<<this->rainfall(i)<<" Inches t"<<this->wind_speed(i)<<"km/htt"<<this->temp(i)<<" C"<<endl;
        }
    }
};

        ///////////////////////////##############################END OF CLASS DECLARATION END OF CLASS DECLARATION END OF CLASS DECLARATION ******************************///////////////////////////////
        ////////////////////////////############################/END OF CLASS DECLARATION END OF CLASS DECLARATION END OF CLASS DECLARATION *****************************///////////////////////////////



int main ()
{
        /* Main program variables 
                                        -> Economic, Weather, Healthy  
  */ 
                                    //Financial Market Alarm System Variables
        int stock_hold;
        string Symbol;
        int amount;
        double open_p;
        double close_p;
        double buy_p;
        
                                        //Weather Alarm System Variables
    int hour=1,StaticHour,FileLine=1;
    Weather day1;
    float FileVal;
    bool Input;
    string work="It Worked!!!",copy_line;
        //Ifile.open("Weather.dat");    *********
                                                                
                        //Diastolic Alarm System Variables
                        
        int age, number,temp,systolic, diastolic,i=1;
        char slash;
        string line, name;
        
      //CONTROL SYSTEM - SELECT (CONTROL SWITCH) //
         int select;
         cout << "Which program would like to access? n (for STOCK SYSTEM: 1 t for SNOWFALL SYSTEM: 2 t for BLOODPRESSURE: 3 t for REGULATORY COMPLIANCE: 4)n";
         cout << "System:";
         cin >> select;
         
    
        //Program .dat files
        ifstream Ifile("Weather.dat");          //data file responsible for sotring information related to the weather (snowfallsystem)
        ifstream file("Medical.dat");       //data file responsible for storing information related to the diastolic
        ofstream stocks("Stockinfo.dat");   //data file responsible for storing information related to the stocks
        ofstream accinfo("AccountInfo.dat"); //data file responsible for storing information related to the bank_account


        switch ( select )  //switch method to alternate between each system
                 
     {
                     case 1 :
                        
                        {
                                        
                 // first change of the second solution (user sets the value of stock_hold
                 cout << "Number of shares: ";
                 cin >> stock_hold;
                 //  defines the number of instances. 
             stock* stok(stock_hold);
    
        for (int i = 0; i < sizeof(stok)/sizeof(*stok); i++)
        {
            cout << "tSTOCK" << i + 1 <<"t"<<endl;
        symbol:
            cout << "Share Symbol: ";
            cin >> Symbol;
    
            if ((Symbol.find_first_not_of(' ') == string::npos) || Symbol.empty() || (Symbol.length() > 4))
            {
                cout << "Symbol cannot be empty and must be less than four characters" << endl;
                goto symbol;
            }
    
        amount:
            cout << "Shares amount: ";
            cin >> amount;
            if (amount <= 0 )
            {
                cout << "Amount cannot be zero or negative.";
                goto amount;
            }
    
        openp: 
            cout << "Stock Opening Price: ";
            cin >> open_p;
    
            if (open_p <= 0)
            {
                cout << "Stock opening price must be higher than zero. Try againn";
                goto openp;
            }
    
        closep:
            cout << "Stock Closing Price: ";
            cin >> close_p ;
    
            if (close_p <= 0)
            {
                cout << "Stock closing price must be higher than zero. Try againn";
                goto closep;
            }
            
        buyp:
            cout << "Share buying price: ";
            cin >> buy_p ;
    
            if (buy_p <= 0)
            {
                cout << "Stock buying cannot be negative or zero. Try againn";
                goto buyp;
            }
            
             
            cout << "n";
            stok(i) = new stock(Symbol, amount, open_p, close_p, buy_p);
            stocks << stok(i)->getSymbol();
            stocks << stok(i)->getVolume();
            stocks << stok(i)->getOpenP();
            stocks << stok(i)->getCloseP();
            stocks << stok(i)->getBuyP();       
        }
        stocks.close();
    
        cout << endl << "ttt" << "----------- Showing Holding Infos ----------ttt" << endl<<endl;
        for (int i = 0; i < stock_hold; i++)
        {
            cout << "SYMBOL = " <<right<< stok(i)->getSymbol() << " | CurrentHolding($) = " << stok(i)->calc_ActualHolding() <<
                "| OpenPriceHolding = "<< stok(i)->calc_OpenHolding()<<" | AfterCloseHolding = "<< stok(i)->calc_CloseHolding()<< endl;
        }
    
        double totalhold = 0;                           //total hold
        double total_hopen = 0;             //total hold at market open
        double total_hclose = 0;            //total hold at market close
    
        cout << endl << "SYMS = ";
        for (int i = 0; i < stock_hold; i++)
        {
            totalhold = totalhold + stok(i)->calc_ActualHolding();
            total_hopen = total_hopen + stok(i)->calc_OpenHolding();
            total_hclose = total_hclose + stok(i)->calc_CloseHolding();
            cout << stok(i)->getSymbol() << " | ";
        }
        cout << endl;
        cout << "Total Holding: " << totalhold << endl;
        cout << "Total Holding at Market Open: " << total_hopen << endl;
        cout << "Total Holding at Market Close: " << total_hclose << endl;
                stocks.close();             
                            break;
            }
                
                
                    case 2 :    //Weather System
                     {
                ifstream Ifile("Weather.dat");          //data file responsible for sotring information related to the weather   
                Ifile.open("Weather.dat");  
                
                if (Ifile.is_open())
                {
                    cout << "File open with success.";
                 }
                while(!Ifile.eof())
    {
        
        Ifile>>FileVal;
        if (FileLine==1) 
        day1.set_wind_speed(FileVal,hour);
        if (FileLine==2)
        day1.set_rainfall(FileVal,hour);
        if (FileLine==3)
        day1.set_snowfall(FileVal,hour);
        if (FileLine==4)
        day1.set_temp(FileVal,hour);
        
    
        if(Ifile.peek()=='n')      //Once file reaches end of line
        {
        FileLine+=1;
        StaticHour=hour;    //To save what hour it is, doesnt matter what line because all lines are same length
        hour=0;     //Sets 0 because new line with new hours
        }
        hour+=1;

    }
Ifile.close();
day1.display(StaticHour);

//**Exceptions throw variables in warning functions in the weather class so if there is a exception value it wont display a warning**//
    try 
    {
                             day1.Check_Wind(StaticHour);
    }
    
    catch (Wind_Error E1)
    {
                            E1.Read_Error();
    }
    
    try
    {
                            day1.Check_Rain(StaticHour); 
    }
    
    catch (Rain_Error E2)
    {
                            E2.Read_Error();
    }
    
    try
    {
                            day1.Check_Snow(StaticHour);
    }
    
    catch (Snow_Error E3)
    {
                            E3.Read_Error();
    }
    
    try
    {
                            day1.Check_Temp(StaticHour);
    }
    
    catch (Temp_Error E4)
    {
                            E4.Read_Error();
    }
    
                        cout<<"If you would like to see all weather values of the day press 1 if not press any other key --> ";
                        cin>>Input;
                        if(Input==1)
                        day1.display_all(StaticHour);
                        else 
                        break;

                        } 
                        
                        
//////////////////// END OF WEATHER SYSTEM PROGRAM /////////////////////////////////////////////////////////////////////////////////
//////////////////// END OF WEATHER SYSTEM PROGRAM /////////////////////////////////////////////////////////////////////////////////

                                    case 3 : // Health Alarm System
                        
                        {
        ifstream file("Medical.dat");       //data file responsible for storing information related to the diastolic                                                
        file.open("Medical.dat");
        
            if (file.fail())
            {
                cout<<"File does not exist";
                return 0;
            }   
                cout<<"Please enter your name: ";
                cin>>name;
                cout<<"Please Enter your age: ";
                cin>>age;
                cout<<"Enter your room number: ";
                cin>>number;
    
        while(getline(file,line))
        {
            
            if (i==1)
            {
                stringstream ss;
                ss<<line;
                while(ss>>systolic>>slash>>diastolic)
                {
            

                if ((age>=18) && (age<25))
                {
                    if ((systolic<108) && (diastolic<75))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                    }
                    else if ((systolic>132) && (diastolic>83))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                    }
                    else 
                    {
                        cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                    }
                }
            
                else if ((age>=25) && (age<30))
                {
                    if ((systolic<109) && (diastolic<76))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                    }
                    else if ((systolic>133) && (diastolic>84))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                    }
                    else 
                    {
                        cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                    }
                }
            
            
                else if ((age>=30) && (age<35))
                {
                    if ((systolic<110) && (diastolic<77))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                    }
                    else if ((systolic>134) && (diastolic>85))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                    }
                    else 
                    {
                        cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                    }
                }
                
            
                else if ((age>=35) && (age<40))
                {
                    if ((systolic<111) && (diastolic<78))
                    {
                        cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                    }
                else if ((systolic>135) && (diastolic>86))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
            else if ((age>=40) && (age<45))
            {
                if ((systolic<112) && (diastolic<79))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                }
                else if ((systolic>136) && (diastolic>87))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
            else if ((age>=45) && (age<50))
            {
                if ((systolic<115) && (diastolic<80))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                }
                else if ((systolic>139) && (diastolic>88))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
            else if ((age>=50) && (age<55))
            {
                if ((systolic<116) && (diastolic<81))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                
                }
                else if ((systolic>142) && (diastolic>89))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
            else if ((age>=55) && (age<60))
            {
                if ((systolic<118) && (diastolic<82))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
                
                }
                else if ((systolic>144) && (diastolic>90))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
            else if ((age>=60) && (age<65))
            {
                if ((systolic<121) && (diastolic<83))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a low blood pressure. "<<endl;
        
                }
                else if ((systolic>147) && (diastolic>91))
                {
                    cout<<name<<", room number "<<number<<",blood pressure is "<<systolic<<"/"<<diastolic<<". Have a high blood pressure."<<endl;
                    
                }
                else 
                {
                    cout<<name<<", room number: "<<number<<", blood pressure is normal."<<endl;
                }
            }
            
        }
        }
            
        if (i==2)
        {   
            stringstream ss;        
            ss<<line;
            
            while(ss>>temp)
            {
            
        
                if(temp<=97)
                {
                    cout<<name<<", room number: "<<number<<", body temperature: "<<temp<<". Have low temperature."<<endl;
                }
                
                else if ((temp>=98) && (temp<=100))
                {
                    cout<<name<<", room number: "<<number<<", body temperature: "<<temp<<"."<<endl;
                }
            
                else if (temp>100)
                {
                    cout<<name<<", room number: "<<number<<", body temperature: "<<temp<<". Have high fever."<<endl;
                }
            }
        }   
        i++;
        
}
file.close();
                break;
} //end of while
                    } //end of switch
 return 0;
} //end of main

//////////////////// END OF HEALTH ALARM SYSTEM PROGRAM /////////////////////////////////////////////////////////////////////////////////
//////////////////// END OF HEALTH ALARM SYSTEM PROGRAM/////////////////////////////////////////////////////////////////////////////////
            

How switch multiple instances of the same app in MacOS?

How switch multiple instances of the same app in MacOS? – Ask Different

SK61 Skyloong Optical hotswappable keyboard random switch on the board doesn’t work (right shift)

So I figured this out typing along and when pressing the switch it actually won’t even let me type a different key. It’s an sk61 from skyloong and it’s a premade keyboard. So I hadn’t touched the internals before this at all and it has never got water damage. I just opened it there to check if it was the switch (optical gateron browns) but I tried another switch that worked fine where it was and nope. So it’s not the switch any ideas as to what I can try other than send this thing back for a new one?

hp proliant – SFP port in ubiquiti switch says RX Fault

guys, so I recently bought an SFP cable to hook up to my server and my switch (Ubiquiti), but today, when I tried to hook everything up in the unifi controller in the port, I was connecting the SFP, I got an error saying RX Fault.

I saw some posts saying to check the bios, and the hardware is being initialized as far as I know. After looking into the bios settings, I reset the partitions to defaults, and the rest of the settings looked like it defaulted too (First time using SFP, so I don’t really know what to look for).

Controller:

enter image description here

Proxmox:

enter image description here

In proxmox, it’s not detecting the connection, but after inspecting the hardware, I saw a green light blink every now, and then so I guess something is being detected, and in proxmox, it detects the hardware/ports.

eno1 and eno2 are from the SFP controller hardware.

Cheapest unmanaged 10GE (10Gbit Ethernet) switch?

What are the cheapest 10GE switches out there that are half-way reputable? I do not need anything fancy managed, but maybe if there are opti… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1841060&goto=newpost

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123