How can you loop in python, unit test, selenium code?

How do I loop around the code to repeat the same padding N times? Or even take the names from a .txt list and enter them in "name"?

def teste(self):
    driver = self.driver
    driver.get("http://painelvix.com/galaxia4/formulario_testes.php?r=UUVJcFdZMXlZcE5XdVU2cGVEUjVMYllMNnVBYS9GajVVUkZ3em9tRDZObz0,")
    driver.find_element_by_name("nome").click()
    driver.find_element_by_name("nome").clear()
    driver.find_element_by_name("nome").send_keys("Teste de preenchimento")
    driver.find_element_by_name("email").click()
    driver.find_element_by_name("email").clear()
    driver.find_element_by_name("email").send_keys("teste@teste.com.br")
    driver.find_element_by_name("perfil()").click()
    driver.find_element_by_xpath("//*/text()(normalize-space(.)='Solicitar')/parent::*").click()
    self.assertEqual("Existe um teste pra este email cadastrado em: 28/03/2019", self.close_alert_and_get_its_text())
    driver.close()

Plus the youngest:

if __name__ == "__main__":
unittest.main()

Run the Python script using Java code

I call a Python script from my Java code with no results:

String cmdStr =
      "C:\ProgramData\Anaconda2\python.exe
       C:\dicom\write_pydicom_cmd.py
      -ip C:\Reconstructed\Test\2019-12-11_16-13-52\MERGEDBEDS_1FRAME.img
      -hp C:\Reconstructed\Test\2019-12-11_16-13-52\MERGEDBEDS_1FRAME.hdr
      -op C:\Reconstructed\Test\2019-12-11_16-13-52\MERGEDBEDS";

Runtime.getRuntime().exec(cmdStr);

When I open the console and call the same script, it works.

Why does not it work with my java code?

C ++ – full intcode computer (code 2019: day 9)

My best languages ​​are Python and Rust, but I want to improve my knowledge of C ++, so I decided to try the Advent of Code 2019 in C ++. I haven't encountered too many problems so far, but I want to know what I'm doing, which is subtly (or not so subtly) wrong.

The following program is my solution for the 9th day problem. It is essentially an interpreter for an invented machine language called intcode. The intcode specification is spread across day 2, day 5 and day 9. The day 7 issues had additional limitations that may explain some of my architectural decisions.

It is not my intention to summarize the entire Intcode specification, but here are some key points about the Intcode language and the computer:

  • Intcode programs require common command and data storage, and most or all of the sample programs use it.
  • An intcode computer has two registers: the command pointer, which I have called the program counter (_pc) and the relative base that I called the stack pointer (_sp). Both are defined to be initialized to zero.
  • Intcode instructions have a variable size and the program counter must be increased by the width of the current instruction in each cycle.
  • Intcode statements support arguments with three different addressing modes: immediate, "positional" (ie direct addressing) and "relative" (ie batch-related addressing). The addressing modes of all arguments of an instruction are encoded in the high digits of its opcode.
  • To solve certain problems, you must start several Intcode computers, connect their inputs and outputs, and run them simultaneously (though not literally at the same time).
  • I created mnemonics for each of the intcode instruction opcodes when I came across them and invented an assembly language for debugging purposes. these are not part of the specification, but you can observe them by commenting out the relevant lines.

My code passes all tests on the website. It's more about eradicating bad habits and avoiding pitfalls than whether the Intcode logic itself is right.

#include 
#include 
#include 
#include 
#include 
#include 
#include 

using Int = long;

enum Opcode {
    ADD = 1,
    MUL = 2,
    INPUT = 3,
    OUTPUT = 4,
    JNZ = 5,
    JZ = 6,
    TESTLT = 7,
    TESTEQ = 8,
    ADDSP = 9,
    HALT = 99,
};

enum class Mode {
    Pos/*ition*/ = 0,
    Imm/*ediate*/ = 1,
    Rel/*ative*/ = 2,
};

class Argument {
public:
    Argument(Mode mode, Int value) : _mode(mode), _value(value) {}

    Mode mode() const {
        return _mode;
    }

    Int value() const {
        return _value;
    }

private:
    Mode _mode;
    Int _value;
    friend std::ostream& operator<<(std::ostream& os, const Argument& self);
};

std::ostream& operator<<(std::ostream& os, const Argument& self) {
    switch (self._mode) {
        case Mode::Imm:
            return os << self._value;
        default:
            std::cerr << "Warning: unknown addressing mode" << std::endl;
            ((fallthrough));
        case Mode::Pos:
            return os << "(" << self._value << ")";
        case Mode::Rel:
            if (self._value < 0) {
                return os << "(sp - " << -self._value << ")";
            } else if (self._value > 0) {
                return os << "(sp + " << self._value << ")";
            } else {
                return os << "(sp)";
            }
    }
}

class Instruction {
public:
    Instruction(const Int* mem) {
        if (mem(0) < 0) {
            throw std::runtime_error("negative opcode");
        }
        _opcode = (Opcode)(mem(0) % 100); // the last two digits are the opcode
        Int addr_modes = mem(0) / 100;
        // parse arguments:
        for (size_t a = 1; a < length(); ++a) {
            auto mode = static_cast(addr_modes % 10);
            _args.emplace_back(mode, mem(a));
            addr_modes /= 10;
        }
        if (addr_modes > 0) {
            std::cerr << "Warning: unused addressing flags";
        }
    }

    Opcode opcode() const {
        return _opcode;
    }

    const Argument& arg(size_t n) const {
        return _args(n);
    }

    /* The code size of this instruction. The amount by which the program
     * counter should be incremented after executing it. */
    size_t length() const {
        switch (_opcode) {
            case ADD:
            case MUL:
            case TESTLT:
            case TESTEQ:
                return 4;
            case JNZ:
            case JZ:
                return 3;
            case INPUT:
            case OUTPUT:
            case ADDSP:
                return 2;
            case HALT:
                return 1;
            default:
                throw std::logic_error("bad opcode in Instruction::length");
        }
    }

private:
    std::vector _args;
    Opcode _opcode;
    friend std::ostream& operator<<(std::ostream& os, const Instruction& self);

    /* The number of input arguments this instruction has. Input arguments are
     * distinguished from output arguments because they may be immediate. In
     * the Intcode machine language, input arguments always precede output
     * arguments. */
    size_t inputs() const {
        switch (_opcode) {
            case ADD:
            case MUL:
            case JNZ:
            case JZ:
            case TESTLT:
            case TESTEQ:
                return 2;
            case OUTPUT:
            case ADDSP:
                return 1;
            case INPUT:
            case HALT:
                return 0;
            default:
                throw std::logic_error("bad opcode in Instruction::inputs");
        }
    }
};

std::ostream& operator<<(std::ostream& os, const Instruction& self) {
    constexpr const char *opcode_names() = {
        NULL, "ADD", "MUL", "INPUT", "OUTPUT", "JNZ", "JZ", "TESTLT", "TESTEQ",
        "ADDSP", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, "HALT"};
    os << opcode_names(self._opcode);
    for (auto& arg: self._args) {
        os << " " << arg;
    }
    return os;
}

class Cpu {
public:
    Cpu(std::ostream& out = std::cout, std::istream& in = std::cin)
        : _pc(0), _sp(0), _out(out), _in(in) {}

    /* for debugging purposes
    void set_name(std::string name) {
        _name = name;
    }
    */

    /* Populates this cpu's memory with data read from a file.
     * Also resets the program counter and stack pointer to 0. */
    void load(const std::string& file_name)
    {
        _mem.clear();
        _pc = 0;
        _sp = 0;
        auto fp = std::ifstream(file_name);
        if (!fp.is_open()) {
            throw std::runtime_error("failed to open input file");
        }
        std::string line;
        Int arg;
        while (fp >> arg) {
            _mem.emplace_back(arg);
            char comma;
            if (!(fp >> comma)) {
                break;
            } else if (comma != ',') {
                throw std::runtime_error("expected ','");
            }
        }
        fp.close();
    }

    /* Runs this Cpu until it halts or stops to wait for input. */
    void run() {
        while (true) {
            Instruction inst(&_mem(_pc));

            //debug() << std::setw(7) << inst << std::endl;
            auto pc_nxt = execute(inst);
            if (pc_nxt) {
                _pc = *pc_nxt;
            } else {
                break;
            }
        }
    }

    /* Returns true if the program is halted, false if it is blocked waiting
     * for input. */
    bool is_halted() {
        return _mem(_pc)%100 == HALT;
    }

private:
    std::vector _mem;
    size_t _pc;
    size_t _sp;
    std::ostream& _out = std::cout;
    std::istream& _in = std::cin;
    //std::optional _name;

    /* Returns a (reference to a) value in memory. */
    Int& lvalue(const Argument& arg) {
        size_t i;
        switch (arg.mode()) {
            case Mode::Imm:
                throw std::logic_error("immediate mode is not available for lvalues");
            default:
                std::cerr << "Warning: unknown addressing mode" << std::endl;
                ((fallthrough));
            case Mode::Pos:
                i = arg.value();
                break;
            case Mode::Rel:
                i = _sp + arg.value();
                break;
        }
        // resize _mem so i is in range
        if (i >= _mem.size()) {
            _mem.resize(i + 1);
        }
        return _mem(i);
    }

    /* Evaluates an argument to an instruction, either immediate or from memory
     * according to the addressing mode of the argument. */
    Int rvalue(const Argument& arg) const {
        size_t i;
        switch (arg.mode()) {
            case Mode::Imm:
                return arg.value();
            default:
                std::cerr << "Warning: unknown addressing mode" << std::endl;
                ((fallthrough));
            case Mode::Pos:
                i = arg.value();
                break;
            case Mode::Rel:
                i = _sp + arg.value();
                break;
        }
        // return 0 for out of range
        if (i >= _mem.size()) {
            return 0;
        }
        return _mem(i);
    }

    /* Executes a single instruction, modifying memory and the stack pointer
     * but not the program counter. */
    std::optional execute(const Instruction& inst) {
        auto arg = (&)(size_t n) { return rvalue(inst.arg(n)); };
        switch (inst.opcode()) {
            case ADD:
                lvalue(inst.arg(2)) = arg(1) + arg(0);
                break;
            case MUL:
                lvalue(inst.arg(2)) = arg(1) * arg(0);
                break;
            case INPUT:
                if (_in >> lvalue(inst.arg(0))) {
                    //debug() << "input = " << arg(0) << std::endl;
                    break;
                } else {
                    _in.clear(); // clear the eof state
                    //debug() << "waiting for input" << std::endl;
                    return std::nullopt;
                }
            case OUTPUT:
                _out << arg(0) << std::endl;
                //debug() << "output = " << arg(0) << std::endl;
                break;
            case JNZ:
                if (0 != arg(0)) {
                    return arg(1);
                }
                break;
            case JZ:
                if (0 == arg(0)) {
                    return arg(1);
                }
                break;
            case TESTLT:
                lvalue(inst.arg(2)) = arg(0) < arg(1);
                break;
            case TESTEQ:
                lvalue(inst.arg(2)) = arg(0) == arg(1);
                break;
            case ADDSP:
                _sp += arg(0);
                break;
            case HALT:
                return std::nullopt;
            default:
                throw std::logic_error("bad opcode in execute");
        }
        return _pc + inst.length();
    }

    /*
    std::ostream& debug() {
        if (_name) {
            std::cerr << std::setw(10) << *_name << ": ";
        }
        return std::cerr;
    }
    */
};

int main() {
    Cpu cpu;
    cpu.load("day09.in");
    cpu.run();
}

I am most interested in knowing what is prone to error, buggy, or just "strange" to an experienced C ++ programmer. I've seen and selected different C ++ styles in action, which makes sense to me, but that does not mean that they make sense overall.

Some specific things that seem a bit awkward are:

  • Cpu::run() Returns either when the program stops or waiting for input. (The customer can call Cpu::is_halted To distinguish these cases.) When the program was waiting for the input, I had to call _in.clear() Within execute to clear the EOF flag from the stream. This seemed a little risky to me because I may be deleting an error flag instead. I suppose I could test for EOF or errors separately, but it just seems a bit cumbersome. Is there a better way to structure the input that I wasn't thinking about?

  • I tried to find a way to write one value Function that interprets an argument contextually as input or output, instead of

    lvalue(inst.arg(2)) = arg(1) + arg(0);
    

    I would be able to write

    value(2) = value(1) + value(0);
    

    and argument 2 would be parsed as an output parameter (for which the immediate addressing mode is not allowed), while arguments 1 and 0 would be parsed as input parameters (for which any addressing mode is allowed). Maybe that was a stupid idea; anyway i thought it would be possible to send it via the constness of thisbut I couldn't find a way to do it. Still, if possible, I'd like to know how.

  • There seems to be a difference between enum and enum class when it comes to how integer values ​​are assigned. I use enum for opcodes and enum class for addressing modes, not really rhyme or reason. I should have used enum class or enum for both? With enum class It seems that you have to give them all explicit values ​​if you want to static_cast work consistently. I did not find much information about this topic online.

  • friend ostream& operator<<: Is this a good way to create a debugable output format?

  • is const std::string& a good way to accept a string argument if you don't need to mutate or copy it? I tried std::string_view but apparently you can not make a from a char *,

  • One of the mistakes I made was as follows: lvalueWhen I tested whether the size of the memory needed to be changed, I used > instead of >=, This caused a subtle error that was only triggered if the address to be written was exactly one after the end of the vector. Valgrind could not detect this error (at least not with standard options). Is there a compiler switch that I can enable, or another tool that makes it easy for me to detect out-of-range index errors while debugging?

  • The vectors for Arguments in Instruction seem a bit extra. I want to save them in a row Instruction, and save on the assignment, since the maximum size is only 3. Is there a typical solution to this type of problem? The only thing I could imagine was an array of 3 optionals and that seemed difficult.

Here is a simple intcode quine to test the code with (day09.in):

109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99

It should be printed after stdout (but with line breaks instead of commas).

Beginners – Daffy Duckifier – Code Review Stack Exchange

Would this ruby ​​code work? It is said to translate normal text in Daffy Duckth Thlang.

# Daffy Duckifier
print "Pleathe enter a thtring!: " 
user_input = gets.chomp
user_input.downcase!
# turns "s" into "th"
if user_input.include? "s"
  user_input.gsub!(/s/, "th")
else
  puts "Nothing Found!"
end
# turns "c" into "sh"
if user_input.include? "c"
  user_input.gsub!(/c/, "sh")
else
  # Nothing to shay!
end
puts "Your thring ith: #{user_input}"

I need to know!

BitVPS – VPS offer with voucher code especially for LEB! $ 8.29 / month

BitVPS has jumped onto our radar with an interesting offer that they are expanding to the LEB community. What they told us is that BitVPS is very different from your ordinary VPS host. You don't need any information to get started, they offer completely anonymous and account-free VPS. You do not need to log in or register to get started. Simply select your server, pay with the cryptocurrency you selected and your server will be provided immediately.

You have provided a coupon code for the offer below. The order link below leads to their full page with a variety of plans, but the specifically listed one is called s-1vcpu-1gb.

As always, we encourage our readers to share their thoughts in the comment section.

You can find your terms and conditions / legal documents here. You accept Bitcoin, Bitcoin SV, Bitcoin Cash, Litecoin, Ethereum, Dash, Pivx, Zcash, Ripple, Digibyte, Qtum, Monero and Tether as payment methods.

Here is the offer:

VPS offer

  • 1024 MB RAM
  • 1x vCPU
  • 25 GB SSD
  • 1 TB transmission
  • 1 Gbps uplink
  • 1x IPv4
  • 1x IPv6
  • KVM
  • Coupon code: LEBEXCLUSIVE
  • $ 8.29 / month
  • [TO ORDER]

NETWORK INFORMATION:

New York, New York, USA

Test IPv4: 45.55.37.238

Test file: http://speedtest-nyc1.digitalocean.com/100mb.test


Host node specifications:

– Intel Xeon dual-hex core processors

– 64 GB RAM

– 8 x 2 TB SSDs

– 1 Gbps uplink

Please let us know if you have any questions / comments and have fun!

Javascript – Jumpy code with descriptive function names

I'm currently building some features on a page. When writing JS I did a number of smaller functions like FindCarouselLocations(elem). GetImagesFromLibrary(url), and BuildCarousels(images, locs) all using a subset of functions contained in my global JS file.

When designing a page that relies heavily on JS, does it make sense to have a single function that tells a story through other function calls? With the above example functions I would do:

// previous function definitions...

function AddImageCarousels (){    
    var imageLibraryUrl = 'http://mysite.com';
    var parentElem = document.querySelectorAll('.image-carousel');

    var images = GetImagesFromLibrary(imageLibraryUrl);
    var locs = FindCarouselLocations(parentElem);
    BuildCarousels(images, locs);
}
document.addEventListener('DOMContentLoaded', AddImageCarousels, false);

Which I think tells a story about what happens when the page loads. I could alternatively remove an abstraction, but would then have to add further comments or redesign in another way. Personally, I think that this creates a bit of self-documentation, but I'm pretty new to development practice.

If there was a lot going on on the page, I would even go one last step and create a function that might look like this:

// previous function definitions...
function AddImageCarousels(){ /* */ }

function BuildPage () {
    AddImageCarousels();
    AddChatbot();
    AddMaintenanceNotification();
}
document.addEventListener('DOMContentLoaded', BuildPage, false);

Where each major functionality has been defined by a single function, however, these functions are similar in structure AddImageCarousels Function.

Is it a proven method or is it a code smell that requires a better design? And if so, what would be a better alternative?

I prefer to save production files in as few separate files as possible to reduce the number of http calls, but each functionality is usually in its own development file and will be translated into it later .js,

Web Browser – How can I understand this seemingly intentionally hidden JS code?

I'm trying to program my own private interface to ask questions on the stack (without using the API, which requires an account that requires minimal anonymity), as I strongly prefer having my own My own "Control Panel", where I can enter it after my own setup.

After spending countless hours with it, I've come to the conclusion that Stack rejects anyone trying to post without JavaScript enabled. When JavaScript is enabled in a normal browser, it will retrieve all types of .js files that are very intricate in generating a string that will be inserted into the hidden form field "i1l" (which is not present in the HTML from the beginning). ,

I meticulously undone this, but I'm stuck in the last step, where it goes crazy with the hidden code. This is how it works (these snippets are from various .js files and have been beautified to make them more meaningful):

The part in which the hidden form element is added with JS:

"loadTicks": function(e) {
    var t;
    t = e ? e.find(".edit-block") : $(".edit-block"), 0 === t.find("input(name=i1l)").length && (t.data("loading-ticks") "http://security.stackexchange.com/" (t.data("loading-ticks", !0), $.ajax({
        "url": "/questions/ticks",
        "cache": !1,
        "success": function(e) {
            t.append("")
        },
        "complete": function() {
            t.data("loading-ticks", !1)
        }
    })))
},

As you can see, the value is set to "e". This is the value sent with the function call on load ticks, loadTicks is mentioned as:

f = function() {
    return StackExchange.helpers.loadTicks(s), d.unbind("keydown", f), !0
};

As you can see, it is called with the variable "s" that was previously defined as:

var s = new Markdown.Converter({
    "nonAsciiLetters": !0,
    "asteriskIntraWordEmphasis": StackExchange.settings.markdown.asteriskIntraWordEmphasis,
    "autoNewlines": StackExchange.settings.markdown.autoNewlines,
    "linkEmails": StackExchange.settings.markdown.linkEmails,
    "codeFences": !StackExchange.settings.markdown.disableCodeFences
});

It matters here Really crazy. The variable "s" is set to the result of Markdown.Converter (…). This function or a set of functions (Is the JavaScript valid at this point? Apparently …) looks like this:

Markdown.Converter = function (t) {
Function i (e) {
return e = e.replace (/ ^ () {0,3}  (((^  ()) +) ) :(  t) *  n? ( t) *(? =  s | $) ( t) *  n? ( t) * (( n *) ("() (. +?) (") ( t) *)? ( n +) / gm, function (e, t, n, r, i, o, a) {
return t = t.toLowerCase (), U.set (t, _ (n)), i? r + a: (o && B.set (t, o.replace (/ "/ g," "")), "http://security.stackexchange.com/")
})
}

Function o (e) {
return e = e.replace (/ ^ (<(p | div | h (1-6) | blockquote | pre | table | dl | ol | ul | script | noscript | form | fieldset | iframe | math | ins | del )  b (^  r) *?  n( t) * (? =  n +)) / gm, s), e = e.replace (/ ^ (<(p | div | h (1-6) | blockquote | pre | table | dl | ol | ul | script | noscript | form | fieldset | iframe | math)  b (^  r) * ?. *( t) * (? =  n +)  n) / gm, s), e = e. Replace (/  n () {0.3} ((<(hr)  b ((^ <>)) *?  /?>) ( T) * (? =  N {2,}) / g, s), e = e.replace (/  n  n () {0,3} (-) | - (^>)) (?: (^ -) | - (^ -)) *) -)> ( t) * (? =  n {2,})) / g, s), e = e .replace (/ (?:  n  n) (() {0,3} (?:<((?%))(^r)*?2>) ( t) * (? =  n {2,})) / g, s)
}

Function a (e) {
return e = e.replace (/ (^  n + |  n + $) / g, "http://security.stackexchange.com/"), " n  n§K" + (q.push ( e) - 1) + "K  n  n"
}

Function s (e, t) {
return a (t)
}

Function l (e, n, r, i) {
e = N.preBlockGamut (e, W), t.codeFences &&! i && (e = w (e)), e = m (e);
var a = "
n "; return e = e.replace (/ ^ () {0,2} (? *) {3,} ( t) * $ / gm, a), e = e.replace (/ ^ () {0, 2} (? -) {3,} ( t) * $ / gm, a), e = e.replace (/ ^ () {0,2} (? _) {3,} ( t) * $ / g, a), e = v (e), e = y (e), e = E (e), e = N.postBlockGamut (e, W), e = o (e), e = C ( e, n, r) } Function c (e) { return e = N.preSpanGamut (e), e = x (e), e = u (e), e = T (e), e = p (e), e = d (e), e = A (e ), e = e.replace (/ P / g, ": //"), e = _ (e), e = H (e), e = t.autoNewlines? e.replace (/ n / g, "
n "): e.replace (/ + n / g,"
n "), e = N.postSpanGamut (e) } Function u (e) { var t = / (<(a-z/!$)("(^")*"http://security.stackexchange.com/"'(^')*"http://security.stackexchange.com/"(^"http://security.stackexchange.com/">)) *> |-) | - (^>)) (?: (^ -) | - (^ -)) *) -)>) / gi; return e = e.replace (t, function (s) { var t = e.replace (/ (.)(α =.) / g, "$ 1"); return t = L (t, "!" == e.charAt (1)? "\` * _ / ":" \ `* _") }) } Function d (e) { return -1 === e.indexOf ("(")? e: (e = e.replace (/ ( ((((?: (^ )) * ) | (^ ())) *) ) ()? (?: n () *)? ((. *?) ) () () () () () / g, f), e = e.replace (/ ( (((?: ((^ )) * ) | (^ ()) *) ) (( t) * ()( t) * ((("http://security.stackexchange.com/")) (. *?) 6 ( t) *)? )) / g, f), e = e. replace (/ ( (((^ ()) +) ) () () () () () / g, f)) } Function f (e, t, n, r, i, o, a, s) { void 0 == s && (s = "http://security.stackexchange.com/"); var l = t, c = n.replace (/: / // g, "§P"), u = r.toLowerCase (), d = i, f = s; if ("http://security.stackexchange.com/" == d) if ("http://security.stackexchange.com/" == u && (u = c.toLowerCase (). replace (/? n / g, "http://security.stackexchange.com/")) , d = "#" + u, invalid 0! = U.get (u)) d = U.get (u), invalid 0! = B.get (u) && (f = B.get (u)); otherwise { if (! (l.search (/ ( s * ) $ / m)> -1)) return l; d = "http://security.stackexchange.com/" } d = M (d); var p = & # 39;+ c (n) + n n " }) } Function v (e, t) { e + = "§0"; var n = / ^ ((() {0,3} ((* + -) | d + (.)) ( t) +) (^ r) +? (§0 | n {2, } (? = S) (?! ( T) * (?: (* + -) | d + (.)) ( T) +)) / gm; Return z? e = e.replace (n, function (e, n, r) { var i, o = n, a = rsearch (/ (* + -) / g)> -1? "ul": "ol"; "ol" === a && (i = parseInt (r, 10)); var s = b (o, a, t); s = s.replace (/ s + $ /, "http://security.stackexchange.com/"); var l<" + a; return i && 1 !== i && (l += ' start="http://security.stackexchange.com/" + i + "http://security.stackexchange.com/"'), s = l + ">"+ s +" n " }): (n = / ( n n | ^ n?) ((() {0.3} ((* + -) | d + (.)) ( t) +) (^ r) +? (§0 | n {2,} (? = S) (?! ( T) * (?: (* + -) | d + (.)) ( T) +) ) / g, e = e.replace (n, function (e, t, n, r) { var i, o = t, a = n, s = rsearch (/ (* + -) / g)> -1? "ul": "ol"; "ol" === s && (i = parseInt (r, 10)); var l = b (a, s), c<" + s; return i && 1 !== i && (c += ' start="http://security.stackexchange.com/" + i + "http://security.stackexchange.com/"'), l = o + c + "> n "+ l +" n " })), e = e.replace (/ §0 /, "http://security.stackexchange.com/") } Function b (e, t) { z ++, e = e.replace (/ n {2,} $ /, " n"), e + = "§0"; varn = K (t), r = new RegExp ("(^ (\ t) *) (" + n + ") (\ t) + ((^ \ r) +? (\ n +)) (? = (§ 0 | \ 1 ("+ n +") (\ t) +) "," gm "), i =! 1; return e = e.replace (r, function (e, t, n, r) { var o = r, a = /nn$/.test(o), s = "http://security.stackexchange.com/" o.search (/ n {2,} /)> -1, c = s "http://security.stackexchange.com/" i; return o = l (R (o),! 0,! c), i = a, "
  • "+ o +"
  • n " }), e = e.replace (/ §0 / g, "http://security.stackexchange.com/"), z--, e } Function y (e) { return e + = "§0", e = e.replace (/ (?: n n | ^ n?) ((? :(? :() {4} | t). * n +) +) ( n * () {0,3} (^ t n) | (? = §0)) / g, function (e, t, n) { var r = t, i = n; Return of r = k (R (r)), r = O (r), r = r.Replace (/ ^ n + / g, "http://security.stackexchange.com/"), r = r .Replace (/ n + $ / g, "http://security.stackexchange.com/"), r = "
    "+ r +"  n

    "," n n "+ r +" n n "+ i
    }), e = e.replace (/ §0 /, "http://security.stackexchange.com/")
    }

    Function w (e) {
    return e = e.replace (/ (?: n | ^) (() {0,3}) (((`~)) 3 {2,}) ((^` n) *) (? = n) ((^ r) *?) (?: ( n n $) | n (() {0,3}) 2 3 * () * (? = n | $ )) / g, function (e, t, n, r, i, o, s) {
    if (o.length && (o = o.substr (1)), t.length) {
    var l = new RegExp ("^ () {1," + t.length + "}", "gm");
    o = o.replace (l, "http://security.stackexchange.com/")
    }
    i = i.trim ();
    var c = "http://security.stackexchange.com/";
    /^(a-z0-9#+-.)+$/i.test(i) && (c = " n n ");
    var u

    " + k(o) + "n

    ";
    return u = a (u), " n n" + c + u + (s "http://security.stackexchange.com/" "http://security.stackexchange.com/")
    })
    }

    Function x (e) {
    return e = e.replace (/ (^ | (^ \ `)) (` +) (?! `) ((^ r) *? (^`)) 2 (?! `) / gm, Function (e, t, n, r) {
    var i = r;
    return i = i.replace (/ ^ (( t) *) / g, "http://security.stackexchange.com/"), i = i.replace (/ ( t) * $ / g, " http://security.stackexchange.com/ "), i = k (i), i = i.replace (/: / // g," §P "), t +"" + i + ""
    })
    }

    Function k (e) {
    return e = e.replace (/ & / g, "&"), e = e.replace (/ </ g, "<"), e = e.replace(/>/ g, "& gt;"), e = L (e, * _ {} () \ `~",! 1)
    }

    Function S (e) {
    return -1 === e.indexOf ("*") && -1 === e.indexOf ("_")? e: (e = F (e), e = e.replace (/ (^ | ( W _)) (?: (?! 1) | (? = ^)) ( * | _) 2 (= S) ((^ r) *? S) 2 2 (?! 2) (? = ( W_) | $) / g, $ 1$ 3"), e = e.replace (/ (^ | ( W _)) (?: (?! 1) | (? = ^)) ( * | _) (? = S) ((? : (?! 2) (^ r)) *? S) 2 (?! 2) (? = ( W_) | $) / g, $ 1$ 3"), V (e))
    }

    Function $ (e) {
    return -1 === e.indexOf ("*") && -1 === e.indexOf ("_")? e: (e = F (e), e = e.replace (/ (? = (^ r) (* _) | (* _)) (^ | (? = W__ | (?! *) ( W _) * * | w * * w) (^ r)) ( * * | __) (?! 2) (? = S) ((?: | (^ r) *? (?! 2) (^ r)) (? = S_ | w | S * * (?: ( W_) | $)).) (? = __ (?: W | $) | * * (?: (^ *) | $)) 2 / g, "$ 1$ 3"), e = e.replace (/ (? = (^ r) (* _) | (* _)) (^ | (? = W_ | (?! *) (?: ( W_) * | D * (? = W) D) (^ r)) ( * | _) (?! 2 2 2) (? = S) ((? :(? ! 2) (^ r)) *? (? = (^ S _) _ | (? = W) D * D | (^ s *) * (?: ( W_ ) | $)).) (? = _ (?: W | $) | * (?: (^ *) | $)) 2 / g, "$ 1$ 3"), V (e))
    }

    Function E (e) {
    return e = e.replace (/ ((^ ( t) *> ( t) ?. + n (. + n) * n *) +) / gm, function (e, t) {
    varn = t;
    return n = n.replace (/ ^ ( t) *> ( t)? / gm, "§0"), n = n.replace (/ §0 / g, "http: // security. stackexchange. com / "), n = n.replace (/ ^ ( t) + $ / gm," http://security.stackexchange.com/ "), n = l (n), n = n.replace (/ (^ | n) / g, "$ 1"), n = n. Replace (/ ( s *

    (^r)+?

    ) / g, function (e, t) {
    varn = t;
    return n = n.replace (/ ^ / gm, "§0"), n = n.replace (/ §0 / g, "http://security.stackexchange.com/")
    }), on("

    n "+ n +" n

    ")
    })
    }

    Function C (e, t, n) {
    e = e.replace (/ ^ n + / g, "http://security.stackexchange.com/") e = e.replace (/ n + $ / g, "http: //security.stackexchange .com) / ");
    for (var r = e.split (/ n {2,} / g) i = (), o = / K ( d +) K /, a = r.length, s = 0; a> s ; s ++) {
    var l = r (s);
    o.test (l)? i.push (l): /S/.test(l) && (l = c (l), l = l.replace (/ ^ (( t) *) / g, n? "http: // security.stackexchange.com/ ":"

    "), n" http://security.stackexchange.com/ "(l + ="

    "), i.push (l))
    }
    if (! t) {
    a = i length;
    for (var s = 0; a> s; s ++)
    for (var u =! 0; u;) u =! 1, i (s) = i (s) .replace (/ K ( d +) K / g, function (e, t) {
    return u =! 0, q (t)
    })
    }
    return i.join (" n n")
    }

    Function _ (e) {
    return e = e.replace (/ & (?! #? (xX)? (? 🙁 0-9a-fA-F) + | w +);) / g, "&"), e = e. replace (/ <(?! (a-z / ?!) | §D) / gi, "<") } function T(e) { return e = e.replace(/\(\)/g, D), e = e.replace(/\((`*_{}()()># + -.!)) / g, D)
    }

    Function j (e, t, n, r) {
    if (t) return e;
    if (")"! == r.charAt (r.length - 1)) return "<" + n + r + ">";
    for (var i = r.match (/ (()) / g), o = 0, a = 0, a < i.length; a++) "(" === i(a) ? 0 >= o? o = 1: o ++: o--;
    var s = "http://security.stackexchange.com/";
    if (0> o) {
    var l = new RegExp ("\) {1," + -o + "} $");
    r = r.replace (l, function (s) {
    return s = e, "http://security.stackexchange.com/"
    })
    }
    if (s) {
    var c = r.charAt (r.length - 1);
    Z.test (c) "http://security.stackexchange.com/" (s = c + s, r = rsubstr (0, r.length - 1))
    }
    Return "<" + n + r + ">"+ s
    }

    Function A (e) {
    e = F (e), e = e. Replace (Q, j), e = V (e);
    var n = function (e, t) {
    var n = M (t);
    Return & # 39;
    "+ N.plainLinkText (t) +""
    };
    return e = e.replace (/<((https?|ftp):(^"http://security.stackexchange.com/"> s) +)> / gi, n), t.linkEmails && (e = e.replace (/ (<| = ")? (?: mailto :)? ((-. w) + @ (- a-z0-9) + (. (- a-z0-9) +) * . (az) +) / gi, I), e = e.replace (/<(?:mailto:)?((-.w)+@(-a-z0-9)+(.(-a-z0-9)+)*.(a-z)+)>/ gi, function (e, t) {
    var n = P (t);
    Return & # 39;& # 39; + n + ""
    })), e
    }

    Function I (e) {
    return e? e.length> 0 && "<" === e(0) ? e : e.length > 1 && "=" === e (0) && "http://security.stackexchange.com/" & # 39; === e (1)? e:<" + e + ">":" http://security.stackexchange.com/ "
    }

    Function P (e) {
    return e = e.replace (/ E ( d +) E / g, function (e, t) {
    var n = parseInt (t);
    return String.fromCharCode (n)
    })
    }

    Function R (e) {
    return e = e.replace (/ ^ ( t | () {1,4}) / gm, "§0"), e = e.replace (/ §0 / g, "http: // security .stackexchange .com / ")
    }

    Function O (e) {
    if (! / t / .test (e)) return e;
    var t, n = ("http://security.stackexchange.com/", "http://security.stackexchange.com/", "http://security.stackexchange.com/", "http: // security.stackexchange.com/ "),
    r = 0;
    return e.replace (/ ( n t) / g, function (e, i) {
    return " n" === e? (r = i + 1, e): (t = (i-r)% 4, r = i + 1, n (t))
    })
    }

    Function M (e) {
    return e = h (e), e = L (e, "* _: () ()")
    }

    Function L (e, t, n) {
    var r = "((+ t.replace (/ (( () \)) / g," \ $ 1 ") +") ";
    n && (r = "\\" + r);
    var i = new RegExp (r, "g");
    return e = e.replace (i, D)
    }

    Function D (e, t) {
    varn = t.charCodeAt (0);
    return "E" + n + "E"
    }
    var N = this.hooks = new n;
    N.addNoop ("plainLinkText"), N.addNoop ("preConversion"), N.addNoop ("postNormalization"), N.addNoop ("preBlockGamut"), N.addNoop ("postBlockGamut"), N.addNoop (" postBlockGamut ") preSpanGamut"), N.addNoop ("postSpanGamut"), N.addNoop ("postConversion");
    var U, B, q, z;
    t = t "http://security.stackexchange.com/" {};
    var F = e,
    V = e;
    t.nonAsciiLetters &&! function () {
    var e = / (Q u00b) u0377-u037a-u0386-u0388-u038a-u0377-u037a-u0386-u0388-u038a-u0377-u037a-u0386-u038a u038c-u038e- u03a1-u03a3-u03f5-u03f7-u0481-u048a-u0523-u0531-u0559-u0523 u05ea u05f0- u05f2 u0621- u064a u0666-u0660-6 u06d5 u06e5- u06e6 u06ee- u06f7f7 u072e6e6e6 - u07a5 u07b1 u07c0 u07ea u07f4 u07f5 u07fa u0904 u09390 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u0 u097 u098c u098f u0990 u0993 u09a8 u09aa u09b0 u09b2 u09b6 u09b9 u09bd u09ce u09dc u09e1 u09df u0a10 u0a13 u0a28 u0a2a u0a30 u0a32 u0a33 u0a35 u0a36 u0a38 u0a39 u0a59 u0a5c u0a6 u0a6f u0a872 u0a8f- u0a91 u0a93- u0a8 u0aaa u0ab0 u0ab2 u0ab3 u0ab5 u0ab9 u0a5d0 u0a0e0 u0ae1 u0b0ae6 u0aef u0b0b0c0c5 - u0b28 u0b2a u0b30 u0b32 u0b33 u0b35 u0b39 u0b3d u0b5c u0b5d u0b5f u0b6 1 u0b66 u0b6f u0b71 u0b83 u0b85 u0b8a u0b8e- u0b90 u0b92 u0b95 u0b99 u0b9 u0b9 u0b9 u0b9 u0bd0 u0be6 u0bef u0c05 u0c0c u0c0e- u0c10 u0c12 u0c28 u0c2a- u0c33 u0c35 u0c39 u0c3d u0c58 u0c61c59 u0c6f u0c8 0c0 u0c8-0 u0caa- u0cb3 u0cb5- u0cb9 u0cbd u0cde u0c0- u0c1 u0c6- u0c0c0c0c5-u0c0c1 u0d12- u0d28 u0d2a- u0d39 u0d60 u0d0 u0d60 u0d60 - u0d7f u0d85- u0d96 u0d9a- u0db1 u0db3- u0dc6 u0db1 u0e01 - u0e30 - u0e32 - u0e33 - u0e40 - u0e46 - u0e50 - u0e59 - u0e81 - u0e82 - u0e84 - u0e87 - u0e88 - u0e8a - u0e9 - u0e8d u0ea5 u0ea7 u0eaa- u0eab u0ead u0eb0 u0eb2-u0eb3 u0ebd u0ec0-u0ec4-u0ec6-u0ed0-u0ed9-u0edc-u0ed u0f00-u0f20-u0- u0- u0- u0 u1000- u102a u103f u1049 u1050 u1055a u105d u1061 u106 5 u1066 u106 u1070 u1075 u1081 u1090 - u10a0 - u10c5 - u10d0 - u10fa - u10fc - u1100 u1159 - u115f - u11a2 - u11a8 - u11f9 - u1200 - u1248 - u124a - u124d - u1250 - u1256 - u1258 - u125a - u125d - u1260 - u1288 - u128a - u128d - u1290 - u12b0 - u12b2 - u12b5 - u12b8 - u12b5 u12c2 u12c5 u12c8 u12d6 u12d8 u1310 u1312 u1318 u135a u1380 u138f u13a0 u13f4 u1401 u166c u166f u16a0- u16ea u1700- u170c u170 u1711 u1720- u1731 u1740- u1751 u1760- u176c u176e u1770 u1780- U1810 - U1819 - U1820 - U1877 - U1880 - U18a8 - U18aa - U1900- U191c - U1946 - U196d - U1970 - U1974 - U1980 - U19a9 - U19c1 - U19c7 - U19d0 - U19d9 - U19e9 U19c1 u1a16 u1b05- u1b33 u1b45 u1b4b u1b50 u1b59 u1b83 u1ba0 u1bae- u1b9 u1c00- u1c23 u1c40 u1c49 u1c4d u1c00-1f1 u1f1 u1f4d u1f50 u1f57 u1f59 u1f5b u1f5d u1f5f u1f7d u1f80 u1fc6- u1fcc u1fd0 u1fd3 u1fd6 u1fdb u1fe0 u1fec u1ff2 u1ff4 u1ff6 u1ffc u203f u2 - u2 - u2 - u2 - u2 u211d - u2124 - u2126 - u2128 - u212a - u212d - u212f - u2139 - u2 13c- u213f u2145 u2149 u214e u2183 u2184 u2c00 u2c2e u2c30 u2c5e u2c60 u2c6f u2c71 u2c7d u2c80 u2c4 u2c2c00 u2d65 u2d6f u2d80 u2d96 u2da0 u2da6 u2da8 u2dae u2db0 u2db6 u2db8 u2dc6 u2dc8 u2dc6 u2dc8 301 - 309 - 300 - - 309 - 30fc - 30ff - 31105 - 3112d - 3101 u31f0- u31ff u3400- u4db5 u4e00- u9fc3 ua000- ua48c ua500- ua60c ua610- ua62b ua640- ua65f ua662- ua66e ua67f ua697 ua717- ua71f ua722- ua788 ua78b- ua78c ua7fb- ua801 ua803- ua805 ua807- ua80a ua80c- ua822 ua840- ua873 ua882- ua8b3 ua8d0- ua8d9 ua900- ua925 ua930- ua946 uaa00- uaa28 uaa40- uaa42 uaa44- uaa4b uaa50- uaa59 uac00- ud7a3 uf900- ufa2d ufa30- ufa6a ufa70- ufad9 ufb0- ufb13- ufb17 ufb1d ufb1f- ufb28 ufb2a ufb36 ufb38- ufb3c ufb3e ufb40- ufb41 ufb43- uufb44 uufb46- uufb1 uufb50 uufbduf-92 uufffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ufe70- ufe74 ufe76- ufefc uff10- uff 19 uff21- uff3a uff3f uff41- uff5a uff66- uffbe uffc2- uffc7 uffca- uffcf uffd2- uffd7 uff - uffdc) / g,
    t = "Q" .charCodeAt (0),
    n = "A" .charCodeAt (0),
    r = "Z" .charCodeAt (0),
    i = "a" .charCodeAt (0) - r - 1;
    F = function (o) {
    return o.replace (e, function (e) {
    for (var o, a = e.charCodeAt (0), s = "http://security.stackexchange.com/"; a> 0;) o = a% 51 + n, o> = t && o ++ , o> r && (o + = i), s = String.fromCharCode (o) + s, a = a / 51 | 0;
    return "Q" + s + "Q"
    })
    }, V = function (s) {
    return e.replace (/ Q ((A-PR-Za-z) {1,3}) Q / g, function (e, o) {
    for (var a, s = 0, l = 0, l < o.length; l++) a = o.charCodeAt(l), a > r && (a - = i), a> t && a -, a - = n, s = 51 * s + a;
    Return String.fromCharCode (s)
    })
    }
    } ();
    var H = t.asteriskIntraWordEmphasis? $: S;
    this.makeHtml = function (s) {
    if (U) throw new Error ("Recursive call to converter.makeHtml");
    return U = new r, B = new r, q = (), z = 0, e = N.preConversion (e), e = e.replace (/ § / g, "§T"), e = e. replace (/ $ / g, "§D"), e = e.replace (/ r n / g, " n"), e = e.replace (/ r / g, " n "), e =" n n "+ e +" n n ", e = O (e), e = e.replace (/ ^ ( t) + $ / gm," http: // security.stackexchange.com/ "), e = N.postNormalization (e), e = w (e), e = o (e), e = i (e), e = l (e ,! 1,! 1 ,! 0), e = P (e), e = replacement (/ D / g, "$$"), e = replacement (/ T / g, "§"), e = N.postConversion (e), q = B = U = zero, e
    };
    var W = function (s) {
    return l (e)
    },
    K = {
    "ol": "\ d + (.)",
    ul: (* + -)
    },
    G = "(-A-Z0-9 + & @ # /%? = ~ _ | (\) ()!:,.;)",
    Y = "(-A-Z0-9 + & @ # /% = ~ _ | (\))",
    Q = new RegExp (& # 39; (= "http://security.stackexchange.com/" <)? \ b (https? | Ftp) (: // & # 39; + G + "*" + Y + ") (? = $ | \ W)", "gi"),
    Z = new RegExp (Y, "i")
    }

    I'm stuck here. I can not make sense of this last part of my life. What is the actual value it wants for the hidden POST field? "i1L"?

    Java – How do I write code to touch and drag features over tiles to enable them in Android?

    Hello dear developers.

    I am very interested in doing a similar word game Microsoft Wordament to the Android. Could someone please suggest resources (articles, books, video tutorials, etc …) in which I can find some kind of guide on how to code this? Touch-and-drag functionality in the android studio.

    Does the Android SDK (and its inherent Android libraries) offer such functionality or do I have to use external frameworks such as Libgdx and exactly?

    Thank you for your help 🙂

    The player in Unity does not respond to Arduino code

    I'm developing this game (as part of a larger game) where the player has to collect all the coins before moving on to the next level. I want the player to get a certain number of button clicks from an Arduino. Each level requires a different number of presses. For example, Level 1 requires 1 click, Level 2 requires 2 clicks, and so on. The problem here is that the player does not respond to the input and I do not know why. When I tested this code with the space bar, the player has moved, so the problem is definitely somewhere between the player and the Arduino. Any tips on how to fix this problem are greatly appreciated.

    This is the Arduino script:

    #include 
    #include
    #include 
    
    // Connect each button with one connection
    // to GND and the other to a digital pin.
    const byte buttonPin = 2;
    const byte buttonPin2 = 3;
    
    class Button{
    
      private:
    
        byte m_buttonPin;
        byte m_counter = 0;
        unsigned long m_buttonPressTimeout;
        unsigned long m_previousMillis;
    
      public:
    
        Button(byte buttonPin):
          m_buttonPin(buttonPin),
          m_counter(0),
          m_buttonPressTimeout(2000), // Button press timeout in ms.
          m_previousMillis(0){}
    
        void Update(){
          if(m_counter > 0 && millis() - m_previousMillis >= m_buttonPressTimeout)
          {
            //Serial.print("Count from Update() just before it's reset to 0 = ");
            Serial.println(GetCounter());
            m_counter = 0;
          }
        }
    
        void IncrementCounter(){
          m_counter++;
          if(m_counter > 4){m_counter = 4;}
          if(m_counter == 1)
          {
            m_previousMillis = millis();
          }
        }
    
        friend void IncrementCounter(Button&);
    
        void IncrementCounter(Button&){
          IncrementCounter();
        }
    
        byte GetCounter(){
          return m_counter;
        }
    
    };
    
    Bounce buttonOneDebouncer = Bounce();
    Bounce buttonTwoDebouncer = Bounce();
    Button ButtonOne(buttonPin);
    Button ButtonTwo(buttonPin2);
    
    void setup(){
      Serial.begin(9600);
      pinMode(buttonPin, INPUT_PULLUP);
      pinMode(buttonPin2, INPUT_PULLUP);
      buttonOneDebouncer.attach(buttonPin);
      buttonTwoDebouncer.attach(buttonPin2);
      buttonOneDebouncer.interval(25);
      buttonTwoDebouncer.interval(25);
    }
    
    void loop(){
    
      // Call the Update function as fast as possible.
      ButtonOne.Update();
      ButtonTwo.Update();
    
      // Button one pressed.
      if(buttonOneDebouncer.update()){
        if(buttonOneDebouncer.fell()){
          if(digitalRead(buttonPin2) == 0){
            ButtonOne.IncrementCounter();
          }
        }
      }
    
      // Button two pressed.
      if(buttonTwoDebouncer.update()){
        if(buttonTwoDebouncer.fell()){
          if(digitalRead(buttonPin) == 0){
            ButtonOne.IncrementCounter(ButtonTwo);
          }
        }
      }
      /*if(digitalRead(buttonPin) == 0 && (digitalRead(buttonPin2) == 0))
      {
      Serial.println("9");
      }*/
    
    }
    

    This is the player script:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    using UnityEngine.SceneManagement;
    using System.IO.Ports;
    
    public class PlayerControllerb : MonoBehaviour
    {
        public static int level;
        (Header("Debug"))
        (SerializeField) private PlatformProvider platformProvider;
        SerialPort sp = new SerialPort("\\.\COM4", 9600);
        //player = GameObject.FindWithTag("Player").GetComponent().material;
        private void Awake()
        {
            OnSceneLoaded();
            SceneManager.sceneLoaded -= OnSceneLoaded;
            SceneManager.sceneLoaded += OnSceneLoaded;
            print(level);
        }
        public void OnSceneLoaded()
        {
    
        }
        public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
        {
            platformProvider = FindObjectOfType();
        }
        public float Speed = 1;
        private int currentPlatformIndex;
        public Vector2 height;
        public float xMin, xMax, yMin, yMax;
    
        string value;
        int amount;
    
        void Start()
        {
            if (!sp.IsOpen)
            { // If the erial port is not open 
                sp.Open(); // Open 
            }
            sp.ReadTimeout = 1; // Timeout for reading
    
            print(level);
        }
    
        void Update()
        {
    
            // if (Input.GetKeyDown(KeyCode.Space) && level == 1)
            //     GoToNextPlatform();
    
            if (sp.IsOpen)
            { // Check to see if the serial port is open 
                try
                {
    
                    value = sp.ReadLine(); //Read the information
                    amount = int.Parse(value);
                    print(amount);
                    //transform.Translate(Speed * Time.deltaTime, 0f, 0f);  //walk
    
                    //if (/*amount > 25f)*/Input.GetKeyDown(KeyCode.Space))  //jump
    
                    if (amount == 1 && level == 1)
                    {
                        //if (Input.GetKeyDown(KeyCode.Space))
                        //{
                        GoToNextPlatform();
                        // GetComponent().AddForce(2* height, ForceMode2D.Impulse);
                    }
                    if (amount == 2 && level == 2)
                    {
                        //if (Input.GetKeyDown(KeyCode.Space))
                        //{
                        GoToNextPlatform();
                        // GetComponent().AddForce(2* height, ForceMode2D.Impulse);
                    }
                    if (amount == 3 && level == 3)
                    {
                        //if (Input.GetKeyDown(KeyCode.Space))
                        //{
                        GoToNextPlatform();
                        // GetComponent().AddForce(2* height, ForceMode2D.Impulse);
                    }
                    if (amount == 4 && level == 4)
                    {
                        //if (Input.GetKeyDown(KeyCode.Space))
                        //{
                        GoToNextPlatform();
                        // GetComponent().AddForce(2* height, ForceMode2D.Impulse);
                    }
                }
                catch (System.Exception)
                {
                }
                /*GetComponent().position = new Vector3
                (
                    Mathf.Clamp(GetComponent().position.x, xMin, xMax),
                    Mathf.Clamp(GetComponent().position.y, yMin, yMax)
                );*/
    
            }
        }
        (ContextMenu(nameof(GoToNextPlatform)))
        public void GoToNextPlatform()
        {
            currentPlatformIndex++;
            currentPlatformIndex = Mathf.Min(currentPlatformIndex, platformProvider.platforms.Length);
    
            GoToPlatform(currentPlatformIndex);
        }
        (ContextMenu(nameof(GoToPreviousPlatform)))
        public void GoToPreviousPlatform()
        {
            currentPlatformIndex--;
            currentPlatformIndex = Mathf.Max(currentPlatformIndex, 0);
    
            GoToPlatform(currentPlatformIndex);
        }
        private void GoToPlatform(int index)
        {
            //StopAllCoroutines();
            //StartCoroutine(MoveTo(platformProvider.platforms(index).transform.position));
    
            gameObject.transform.position = platformProvider.platforms(index).transform.position;
        }
        IEnumerator MoveRoutine(Vector3 target)
        {
            while (!Mathf.Approximately(0, Vector3.Distance(transform.position, target)))
            {
                yield return new WaitForFixedUpdate();
                GetComponent().MovePosition(Vector3.MoveTowards(GetComponent().position, target, Time.deltaTime * Speed));
            }
        }
    
        private void FixedUpdate()
        {
            GetComponent().position = new Vector3
    
                       (
                            Mathf.Clamp(GetComponent().position.x, xMin, xMax),
                            Mathf.Clamp(GetComponent().position.y, yMin, yMax)
                        );
        }
        void ApplicationQuit()
        {
            if (sp != null)
            {
    
                {
                    sp.Close();
                }
            }
        }
    
    }
    

    This is an image of the console to show that the entries are being registeredconsole, Here is a picture of the game: game