Arjun Thakur has Published 1109 Articles

In MySQL, how FIELD() function is different from FIND_IN_SET() function?

Arjun Thakur

Arjun Thakur

Updated on 20-Jun-2020 08:49:28

1K+ Views

As we know, both the functions are used to search a string from the arguments provided in them but there are some significant differences between them as follows −FIND_IN_SET() −  function uses the string list that is itself a string containing the substring separated by commas. Whereas, FIELD() function contains ... Read More

What MySQL ASCII() function returns if no parameter is provided to it?

Arjun Thakur

Arjun Thakur

Updated on 20-Jun-2020 07:38:56

96 Views

In this case, it means we are providing an empty string as an argument to the ASCII() function. It will return 0 on providing empty string.Examplemysql> Select ASCII(''); +-----------+ | ASCII('') | +-----------+ |     0     | +-----------+ 1 row in set (0.00 sec)

How can we apply filtering criteria at group levels of the result set returned by MySQL?

Arjun Thakur

Arjun Thakur

Updated on 20-Jun-2020 06:39:36

75 Views

As we know that GROUP BY clause in a SELECT statement can divide the result set, returned by MySQL, in groups. Now if we want to return only some specific groups then need to apply filtering criteria at the group level. It can be done by using HAVING clause inside ... Read More

Reserved keywords in C++?

Arjun Thakur

Arjun Thakur

Updated on 19-Jun-2020 05:31:50

9K+ Views

A reserved word is a word that cannot be used as an identifier, such as the name of a variable, function, or label – it is "reserved from use". This is a syntactic definition, and a reserved word may have no meaning.There are a total of 95 reserved words in ... Read More

Who’s Who in the Internet Standards World

Arjun Thakur

Arjun Thakur

Updated on 18-Jun-2020 07:01:44

3K+ Views

Internet Standards refer to all the documented requirements both in technology as well as methodology pertaining to the Internet. The standardization process has three steps. The documentation laid down in a step is called the maturity level. There were previously three maturity levels but are merged to form only two ... Read More

How to convert numbers to words using Python?

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 14:48:33

1K+ Views

The constructor for the string class in python, ie, str can be used to convert a number to a string in python. For example, i = 10050 str_i = str(i) print(type(str_i))This will give the output:But if you want something that converts integers to words like 99 to ninety-nine, you have ... Read More

How to handle exception inside a Python for loop?

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 12:20:33

3K+ Views

You can handle exception inside a Python for loop just like you would in a normal code block. This doesn't cause any issues. For example, for i in range(5):    try:       if i % 2 == 0:          raise ValueError("some error")       ... Read More

Can you please explain Python dictionary memory usage?

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 11:40:07

611 Views

The dictionary consists of a number of buckets. Each of these buckets containsthe hash code of the object currently stored (that is not predictable from the position of the bucket due to the collision resolution strategy used)a pointer to the key objecta pointer to the value objectThis sums up to ... Read More

How to Pretty print Python dictionary from command line?

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 11:14:32

730 Views

You can pretty print a dict in python using the pprint library. The pprint module provides a capability to “pretty-print” arbitrary Python data structures in a form which can be used as input to the interpreter. You can use it as followsExamplea = {    'bar': 22,    'foo': 45 ... Read More

How to convert Python dictionary keys/values to lowercase?

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 11:05:23

4K+ Views

You can convert Python dictionary keys/values to lowercase by simply iterating over them and creating a new dict from the keys and values. For example, def lower_dict(d):    new_dict = dict((k.lower(), v.lower()) for k, v in d.items())    return new_dict a = {'Foo': "Hello", 'Bar': "World"} print(lower_dict(a))This will give the ... Read More

Advertisements