To access the UNIX shadow password database, we should use the spwd module. We need enough privileges to access this file. The shadow password database entries are like tuple like object. To use the spwd module, we should import it using − import spwd The attributes of the shadow password database are − Index Attribute & Description 0 sp_nam The Login Name or the username of the user 1 sp_pwd The Encrypted password 2 sp_lstchg Date of last change 3 sp_min Minimal number of days ... Read More
In 8085 Instruction set, DCR is a mnemonic, which stands for ‘DeCRement’ and ‘R’ stands for any of the following registers, or memory location M pointed by HL pair. R = A, B, C, D, E, H, L, or M This instruction is used to decrease the content of register R. Also we can say it will subtract 1 from the register R content. And the decremented value will be stored on to the register R itself. As it is an arithmetic instruction, so all flags, except Cy flag, are affected depending on the result. In those assembly ... Read More
Quantifiers in C# specify how many instances of the previous element (which can be a character, a group, or a character class) must be present in the input string for a match to occur. Quantifier Description Pattern Matches * Matches the previous element zero or more times. \d*\.\d ".0", "19.9", "219.9" + Matches the previous element one or more times. "be+" "bee" in "been", "be" in "bent" ? Matches the previous element zero or one time. "rai?n" "ran", "rain" { n } Matches the previous element exactly n ... Read More
To verify UNIX password, we should use the crypt module. It has crypt(3) routine. It is basically one-way hash function based on the modified DES algorithm. To use the crypt module, we should import it using. import crypt Method crypt.crypt(word, salt) This method takes two arguments. The first one is the word and second one is salt. The word is basically the user password, which is given in the prompt. The salt is a random string. It is used to perturb the DES Algorithm in one of 4096 ways. The salt contains only Upper-case, Lower-case, Numeric values ... Read More
Var is strictly typed in C#, whereas dynamic is not strictly typed. Var declaration var a = 10; Dynamic declaration dynamic a = 10; A Var is an implicitly typed variable, but it will not bypass the compile time errors. Example of var in C# var a = 10; a = "Demo"; // gives compile error Example of dynamics in C# dynamic a = 10; a = "Demo"; // won’t give error
The termios module provides an interface to the POSIX for tty I/O control. It is only available for Unix system. To use the termios module, we should import it using − import termios All methods in this module, takes the file descriptor as an argument. There are some modules of the termios module, these are − Method termios.tcgetattr(fd) This method returns a list of tty attributes for the given file descriptor. The attributes are iflag, oflag, cflag, lflag, ispeed, ospeed, cc. Method termios.tcsetattr(fd, when, attributes) This method is used to set the attribute from the list of attributes. ... Read More
To change the terminal controls in the Unix system, we can use the tty related methods in Python. Using the tty module, we can set two different modes of the terminal. The raw Mode and the cbreak mode. To use the tty module, we should import it using − import tty There are some modules of the tty module, these are − Method tty.setraw(fd, when = termios.TCSAFLUSH) This method is used to change the terminal mode to raw mode. In the raw mode, the cursor moves to new line but the carriage return operation is not performed. Also ... Read More
In 8085 Instruction set, SBB R is mnemonic used for multi-Byte subtraction. Let us consider the following example on such subtraction In this above example, the subtraction of 62H and F1H will result in 71H with a borrow of 1. Next, we have to subtract 44H and 13H along with this borrow value of 1. In the above tracing we have shown you how the internal calculations are being done. Now in 8085, to facilitate such an operation, SBB instruction has been provided to subtract two numbers along with the borrow value. SBB is a mnemonic that stands for ... Read More
There are various categories of characters, operators, and constructs that lets you to define regular expressions. One of them is Grouping Constructs. Grouping constructs describe sub-expressions of a regular expression and capture substrings of an input string. The following table lists the grouping constructs. Grouping construct Description Pattern Matches ( subexpression ) Captures the matched subexpression and assigns it a zero-based ordinal number. (\w)\1 "ee" in "deep" (?< name >subexpression) Captures the matched subexpression into a named group. (?< double>\w)\k< double> "ee" in "deep" (?< name1 -name2 >subexpression) Defines a balancing group ... Read More
The Pseudo-terminal utility module pty is defined to handle pseudo-terminal concepts. Using this we can start another process, and also can read or write from controlling terminal using programs. This module is highly platform oriented. We should use UNIX systems to perform these operations. To use the pty module, we should import it using − import pty There are some modules of the pty module, these are − Method pty.fork() This method is used to connect the child controlling terminal to pseudo-terminal. This method returns the pid and the fd. The child process gets the pid 0, but ... Read More