Difference between text and varchar (character varying)

There is no difference, under the hood it’s all varlena (variable length array). Check this article from Depesz: http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/ A couple of highlights: To sum it all up: char(n) – takes too much space when dealing with values shorter than n (pads them to n), and can lead to subtle errors because of adding trailing … Read more

Extract substring in Bash

You can use Parameter Expansion to do this. If a is constant, the following parameter expansion performs substring extraction: b=${a:12:5} where 12 is the offset (zero-based) and 5 is the length If the underscores around the digits are the only ones in the input, you can strip off the prefix and suffix (respectively) in two … Read more

How to compare strings in Bash

Using variables in if statements if [ “$x” = “valid” ]; then echo “x has the value ‘valid'” fi If you want to do something when they don’t match, replace = with !=. You can read more about string operations and arithmetic operations in their respective documentation. Why do we use quotes around $x? You … Read more

Ukkonen’s suffix tree algorithm in plain English

The following is an attempt to describe the Ukkonen algorithm by first showing what it does when the string is simple (i.e. does not contain any repeated characters), and then extending it to the full algorithm. First, a few preliminary statements. What we are building, is basically like a search trie. So there is a … Read more

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