Invisible characters – ASCII

I just went through the character map to get these. They are all in Calibri. Number    Name      HTML Code    Appearance ——    ——————–  ———    ———- U+2000    En Quad           “ ” U+2001    Em Quad           “ ” U+2002    En Space        “ ” U+2003    Em Space        “ ” U+2004  Three-Per-Em Space      “ ” U+2005  Four-Per-Em … Read more

What is the maximum number of bytes for a UTF-8 encoded character?

The maximum number of bytes per character is 4 according to RFC3629 which limited the character table to U+10FFFF: In UTF-8, characters from the U+0000..U+10FFFF range (the UTF-16 accessible range) are encoded using sequences of 1 to 4 octets. (The original specification allowed for up to six byte character codes for code points past U+10FFFF.) … Read more

How to avoid pressing Enter with getchar() for reading a single character only?

This depends on your OS, if you are in a UNIX like environment the ICANON flag is enabled by default, so input is buffered until the next ‘\n’ or EOF. By disabling the canonical mode you will get the characters immediately. This is also possible on other platforms, but there is no straight forward cross-platform … Read more

Characters allowed in GET parameter

There are reserved characters, that have a reserved meanings, those are delimiters — :/?#[]@ — and subdelimiters — !$&'()*+,;= There is also a set of characters called unreserved characters — alphanumerics and -._~ — which are not to be encoded. That means, that anything that doesn’t belong to unreserved characters set is supposed to be … Read more

How many characters can be stored in 4KB?

Here is a visual cue how much 1024 or 4096 are. Read @Jon Snyder’s message to get a better understanding. 1024 Characters (Assuming Characters have 4 bytes): Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec … Read more

range over character in python

This is a great use for a custom generator: Python 2: def char_range(c1, c2): “””Generates the characters from `c1` to `c2`, inclusive.””” for c in xrange(ord(c1), ord(c2)+1): yield chr(c) then: for c in char_range(‘a’, ‘z’): print c Python 3: def char_range(c1, c2): “””Generates the characters from `c1` to `c2`, inclusive.””” for c in range(ord(c1), ord(c2)+1): … Read more

How to get the last X Characters of a Golang String?

You can use a slice expression on a string to get the last three bytes. s := “12121211122” first3 := s[0:3] last3 := s[len(s)-3:] Or if you’re using unicode you can do something like: s := []rune(“世界世界世界”) first3 := string(s[0:3]) last3 := string(s[len(s)-3:]) Check Strings, bytes, runes and characters in Go and Slice Tricks.

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