Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Character



  Solution to getKeyCode() returns 0 in Java

The getKeyChar method always returns a valid Unicode character or CHAR_UNDEFINED. Character input is reported by KEY_TYPED events: KEY_PRESSED and KEY_RELEASED events are not necessarily associated with character input. Therefore, the result of the getKeyChar method is guaranteed to be meaningful only for KEY_TYPED events.For key pressed and key released events, the getKeyCode method returns the event's keyCode. For key typed events, the getKeyCode method always returns VK_UNDEFINED....

   Java,KeyCode,0,KeyListener     2011-06-06 10:38:11

  Work with MySQL character set and collation

For non-English websites, they often have to deal with character set and collation if they want to store data to and read data from databases with other languages. Character set tells the database which kind of character encoding scheme to use to store or read data, collation can be simply understood as a subset of character set, it tells the database how to sort data. We talk about working with character set and collation of MySQL today.  In MySQL, if we want to store Chinese, Japanese or ...

   MySQL,character set,collation,Chinese,question mark     2012-06-17 07:07:28

  Fastjson just fixed a bug which might cause out of memory issue

Fastjson just fixed a bug which might cause service down a few days ago. This bug is caused by some mishandling of special character \x which is an escaped character to indicate hexdecimal number. The impact of this bug would be big if the attacker constructs a malicious data which would cause the service down.  The code which causes the issue is in com.alibaba.fastjson.parser.JSONLexerBase#scanString, when a JSON string is passed in, fastjson would parse the string character by c...

   FASTJSON,ALIBABA,BUG,NEWS     2019-09-07 06:03:49

  How regular expression works

Rob Pike wrote 30 lines of codes to realize a simple regular expression matcher in his book The practice of Programming. This piece of code is really cool. Let's take a look at the code.Meaning of different characters.Character Meaning c General character . Match any single character ^ Match start of a string $ Match end of a string * Match zero or many occurrences of a character /*match :Test the regexp in text*/int match(char* regexp,char* text){    if(regexp[0] == '^')&n...

   Regular expression,Implementation,Rob Pike,C     2012-06-25 05:23:41

  How does Base64 work

Base64 is a data encoding scheme used in safe data transfer such as HTTP and its extensions. Base64 encoding can conver arbitrary group of bytes into a sequence of readable ASCII characters. These converted characters can safely put in a HTTP header without causing any problem while the peers process the HTTP header. Base64 encoding was invented as part of the MIME content transfer encoding. It is similar to other encoding schemes such as Uuencode and BinHex but with higher efficiency....

   ALGORITHM,BASE64     2016-03-09 23:47:40

  Carriage return and line feed

In programming and document editing, we may frequently encounter carriage return and line feed, i.e the well known CRLF.  But do you know about the history and difference of carriage return and line feed? Before computer came out, there was a type of teleprinter called Teletype Model 33. It can print 10 characters each second. But there is one problem with this, after finishing printing each line, it will take 0.2 second to move to next line, which is time of printing 2 characters. If a new...

   CR,CARRIAGE RETURN,LINE FEED,LF,NEW LINE,CRLF     2017-02-19 08:29:23

  You know what UTF-8 is when you see it?

When we are coding we may often see some encoding specifications in our source codes such as UTF-8,GB2312. Do you know what these encoding mean and why we need them? In this post, Julián Solórzano will introduce the most widely used encoding specification around the world accomodating all different character sets in the world. UTF-8 is a method for encoding Unicode characters using 8-bit sequences. Unicode is a standard for representing a great variety of characters from many ...

   UTF-8,Encoding     2014-04-18 22:13:44

  Can we believe our eyes?

Several days ago, one of our customers submitted a sample (SHA1: fbe71968d4c5399c2906b56d9feadf19a35beb97, detected as TrojanDropper:Win32/Vundo.L). This trojan hijacks  the hosts “vk.com” and “vkontakte.ru” (both social networking sites in Russia)and redirects them to 92.38.209.252, but achieves this in an unusual way. A common  method used to hijack a website and redirect it to a site of the attacker’s choice is to add an entry in the Windows hosts f...

   Window,Software,Eye,Weired     2011-08-22 12:12:16

  Learn how to tell a story before building your own start-ups

Imagine one day you become a successful start-up founder like Mark Zuckerberg, then somebody will come and find you and want to shoot a movie for you with your start-up story. If you are not successful yet, then this story should be written by yourself. For start-up founders, learn how to tell a story will not only promote yourself among investors, users and medias but also can create a macro development plan for your start-ups by explaining various unexpected things will happen. Pixar storyboa...

   Start-up,rules,Pixar     2013-03-10 10:06:54

  Differences between bashrc and profile in Linux

After login to a Linux system, the command console will show up with a prompt label such as # or ~, a shell command can be typed after this prompt and the system can execute the command thereafter. All these operations are handled by shell. Shell is a command language interpreter that executes commands read from the standard input device (keyboard) or from a file. There are different types of shells such as bash, ksh, csh etc. The most commonly used of them is bash and it's also the de...

   LINUX,PROFILE,BASH,BASHRC,.BASHRC,.PROFILE     2016-11-05 22:17:51