ngrok: tcp forwarding to 25565 (minecraft server)

One guess: your terminal window is a fixed width and it is cutting off the port number. In particular when you include region, the hostname becomes 3 characters longer than the usual: x.tcp.xx.ngrok.io vs x.tcp.ngrok.io, which fits the fact that you are seeing a port number that is 3 digits shorter than usual. To get … Read more

What are the rules of the std::cin object in C++?

What is happening here is that std::cin >> firstName; only reads up to but not including the first whitespace character, which includes the newline (or ‘\n’) when you press enter, so when it gets to getline(std::cin, articleTitle);, ‘\n’ is still the next character in std::cin, and getline() returns immediately. Adding ‘std::cin >> std::ws‘ (ws meaning … Read more

max value of integer

In C, the language itself does not determine the representation of certain datatypes. It can vary from machine to machine, on embedded systems the int can be 16 bit wide, though usually it is 32 bit. The only requirement is that short int <= int <= long int by size. Also, there is a recommendation that int should represent the native capacity of the processor. All types … Read more

What does ERR_SPDY_PROTOCOL_ERROR mean in nginx?

I came across this question when trying to find help for the problem I was facing with ERR_SPDY_PROTOCOL_ERROR on Chrome. Thought this might benefit others. Our situation / solution: We use an AWS Application Load Balancer connected to EC2 instances. One of the scripts we run on EC2 proxies requests from the client browser. We recently updated the script – no … Read more

How can I sort a dictionary by key?

Standard Python dictionaries are unordered (until Python 3.7). Even if you sorted the (key,value) pairs, you wouldn’t be able to store them in a dict in a way that would preserve the ordering. The easiest way is to use OrderedDict, which remembers the order in which the elements have been inserted: Never mind the way od is printed out; it’ll … Read more

Why the range of int is -32768 to 32767?

Because of how numbers are stored. Signed numbers are stored using something called “two’s complement notation”. Remember all variables have a certain amount of bits. If the most significant one of them, the one on the left, is a 0, then the number is non-negative (i.e., positive or zero), and the rest of the bits … Read more

What is JNDI? What is its basic use? When is it used?

What is JNDI ? It stands for Java Naming and Directory Interface. What is its basic use? JNDI allows distributed applications to look up services in an abstract, resource-independent way. When it is used? The most common use case is to set up a database connection pool on a Java EE application server. Any application that’s … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)