Website Blocker Using Python

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

1K+ Views

If you are working in a big IT company then you may notice that their couple of websites are blocked especially social networking sites like facebook, youtube, Instagram etc.Instead of using third-party applications to blocks certain website, we can develop our own custom application which will block websites of our choice and developing a website blocker in python is not so difficult too. That’s what we going to do- develop a python script which will block the website we want.Prerequisite:Python 3.x installedBasic knowledge of PythonWhat we are going to do:We are going to develop python application which will block a ... Read More

MySQL LIKE Operator

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

2K+ Views

You can implement MySQL Like IN() with the help of Regular Expression (regexp) as well. The syntax is as follows −select *from yourTableName where yourColumName regexp ‘value1|value2|value3……|valueN’;To understand the above logic, you need to create a table. Let us first create a table −mysql> create table INDemo -> ( -> Id int, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.90 sec)Insert some records into the table. The query is as follows −mysql> insert into INDemo values(100, 'John'); Query OK, 1 row affected (0.13 sec) mysql> ... Read More

MySQL Command for Displaying Current Configuration Variables

George John
Updated on 30-Jul-2019 22:30:24

2K+ Views

To display current configuration variables, you can use show command. The syntax is as follows −show variables;You can further rewrite the above syntax with LIKE operator. The syntax is as follows −show variables like ‘%anyStringValue%’;The query is as follows displaying an example to fetch some of the configuration variables −mysql> show variables like '%max%';Output+------------------------------------------------------+----------------------+ | Variable_name                                        | Value                | +------------------------------------------------------+----------------------+ | binlog_max_flush_queue_time                         ... Read More

NavigableMap Size Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

90 Views

To get the size of NavigableMap, use the size() method. It returns the count of elements in the NavigableMap.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, get the size −n.size();The following is an example to implement the size() method to get the size of the NavigableMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); ... Read More

Convert 8-Bit Number into Grey Number in 8085

Anvi Jain
Updated on 30-Jul-2019 22:30:24

299 Views

In this program we will see how to find the gray code from an 8-bit number.Problem StatementWrite 8085 Assembly language program to convert an 8-bit number stored at 8000H to its equivalent gray code. The result will be stored at 8050H.DiscussionIn this program we are converting binary to gray code. The procedure is simple. At first we have to shift the content to the right, then perform XOR operation with the sifted content and the actual content. Thus we will get the gray code. For an example if the number is ABH, then the binary value will be (1010 1011), ... Read More

Modes of Operation in a Helical Antenna

Knowledge base
Updated on 30-Jul-2019 22:30:24

3K+ Views

A helical antenna is another type of wire antenna, which is widely used for a higher range of broadband VHF and UHF applications. The frequency range of operation of the helical antenna is around 30MHz to 3GHz.Helical antenna or helix antenna is the antenna in which the conducting wire is wound in a helical shape and connected to the ground plate with a feeder line. It is the simplest antenna which provides circularly polarized waves and used in extra-terrestrial communications in which satellite relays etc., are involved.It consists of a helix of thick copper wire or tubing wound in the ... Read More

Limit of Auto Increment Integer in MySQL

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

1K+ Views

The limit of auto_increment integer depends on column data type. Displayed as follows:The data type TINYINT range is 127 The data type UNSIGNED TINYINT range is 255 The data type SMALLINT range is 32767 The data type UNSIGNED SMALLINT range is 65535 The data type MEDIUMINT range is 8388607 The data type UNSIGNED MEDIUMINT range is 16777215 The data type INT range is 2147483647 The data type UNSIGNED INT range is 4294967295 The data type BIGINT range is 9223372036854775807 The data type UNSIGNED BIGINT range is 18446744073709551615Let us take an example of TINYINT. If you will give beyond 127, then ... Read More

Keyed Hashing for Message Authentication in Python

Samual Sam
Updated on 30-Jul-2019 22:30:24

931 Views

Message authentication using cryptographic hash functions in python can be achieved through the HMAC mechanism. We can use HMAC with multiple iterable hash functions such as MD5, SHA-1 in combination with a secret shared key.The basic idea is to secure our data, by generating a cryptographic hash of the actual data combined with a shared secret key. The final result is sent without the secret key but the resulting hash can be used to check the transmitted or stored message.Syntaxhmac.new(key, msg = None, digestmod = None)Returns a generate new hmac object.Where −Key – The shared secret key here.Msg – the ... Read More

Encrypt MS Excel Workbook

yashwanth sitamraju
Updated on 30-Jul-2019 22:30:24

676 Views

A procedure should be followed for encrypting an MS Excel. Encryption is nothing but protecting your document from a third party. First, let us look into the definition of encryption.What is Encryption?The word encryption is derived from the Greek word Kryptos means hidden or a secret.There are certain algorithms to use encryption like RSA algorithms and Diffie-Hellman key exchange algorithms.These algorithms led to the use of encryption in commercial and consumer realms to protect data.The password is the best example of encryption.Encryption is used in sending data across all the networks and ATM is also one of the examples for ... Read More

Concat Values in MySQL Query and Handle Null Values

Ankith Reddy
Updated on 30-Jul-2019 22:30:24

1K+ Views

You can use CONCAT() method to concatenate values while IFNULL() method is used to handle NULL values. The syntax is as follows:SELECT CONCAT('anyStringValue:', IFNULL(yourColumnName, 'anyStringValue’)) AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ConcatValues    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> FirstName varchar(20),    -> MiddleName varchar(20),    -> LastName varchar(20),    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert ... Read More

Advertisements