I came across the following code and could not understand what was going on.
def self.eof_packet?(data) data[0] == ?\xfe && data.length == 5 end
?starts a literal letter .
?
\xlaunches hexadecimal escape .
\x
The hexadecimal number of FE, which is 254
This is the letter of the hexadecimal character. You can also use 0xfethat also works for large numbers (e.g. 0x100) that do not fit in bytes.
0xfe
0x100
Source: https://habr.com/ru/post/1749695/More articles:In CSS, does this make sense or is it legal to embed an identifier in another identifier - for example, #main #display img {...} "- cssCassandra replication system - how it works - installationБолее локализованный, эффективный алгоритм Lowest Common Ancestor, заданный несколькими бинарными деревьями? - language-agnosticИспользование метода IBAction, когда он не вызывается из действия? - methodsCan I create a rain effect in javascript? - javascriptError in my implementation of Floyd-Warshall C ++ - c ++Android: is it possible to programmatically expand the range of WiFi? - androidList all possible values for enumerating SOAP using Python SUDS - pythonCapture console output in TestNG? - testngOpenGL - GL_FRONT vs GL_FRONT_AND_BACK - openglAll Articles