Edited, memorised or added to reading queue

on 04-Feb-2019 (Mon)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 3184295021836

Question
In git, how to you get info (i.e. url) of the repositories you push to/pull from
Answer
git remote -v

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill






Flashcard 3511609068812

Question
In algorithms, for BinarySearchTree delete method (def delete(self, data): ), first thing you need to do is [...multi word description...] , then there is three cases to handle (node to delete has 0 children, node to delete has 1 child, node to delete has 2 children).
Answer

get the pointer to node to delete and its parent (using helper method: get_node_with_parent(self, data), which returns (parent, node) ):

Here is the helper function implementation (as a bonus):

   def __get_node_with_parent(self, data):
       parent = None
       current = self.root_node
       while current:
           if data == current.data:
               return (parent, current)
           parent = current
           if data < current.data:
               current = current.left_child
           else:
               current = current.right_child
       return (None, None)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511646555404

Question

In algorithms/python, implement the search method below for BinarySearchTree class:

class Node:        
    def __init__(self, data):            
        self.data = data
        self.left_child = None
        self.right_child = None


class BinarySearchTree:        
    def __init__(self):            
        self.root_node = None
...
...

    # method returns True if data found, False otherwise
    def search(self, data):
        #### IMPLEMENT THE BODY OF THIS METHOD #########

Answer
    # method returns True if data found, False otherwise
    def search(self, data):
        current = self.root_node
        while current:
            if data == current.data:
                return True
            elif data < current.data:
                current = current.left_child
            else:
                current = current.right_child
        return False

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3811043052812

Question
In linux, what is the difference between the bin vs sbin subdirectory superstructure?
Answer

bin is where executables are placed for all normal users, sbin (superuser bin), is where executables for the root user are placed.

^^ also note that all the bin directories will be in the PATH for all normal users (e.g. /bin, /usr) while the sbin directories will be in the PATH for the root user

^^^ s in sbin stands for superuser


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
17. Overview of the UNIX Directory Layout
and their descriptions is as follows: bin Binary executables. Usually all bin directories are in the PATH environment variable so that the shell will search all these directories for binaries. <span>sbin Superuser binary executables. These are programs for system administration only. Only the root will have these executables in their PATH . lib Libraries. All other data needed by progra







Flashcard 3814567316748

Question
In linux, disk partitions (cylendrical chunks of the hard drive disk) can be formatted (or listed) via the [...] command.
Answer
fdisk

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
/dev/hda5 , /dev/hda6 , and so on. 19.2 Partitioning a New Disk A new disk has no partition information. Typing fdisk will start an interactive partitioning utility. The command fdisk /dev/hda <span>fdisk s your primary master. What follows is an example of the partitioning of a new hard drive. Most distributions these days have a simpler graphical system for creating partitions, so usin







Flashcard 3814570986764

Question
In linux, a [...] partition, is a disk partition (cylendrical chuck of hard drive disk) that can be used as extended RAM (to faciliate programs when RAM is low)
Answer
swap

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
access [...] 12 Compaq diagnost 56 Golden Bow a5 BSD/386 ff BBT 14 Hidden FAT16 <3 5c Priam Edisk fdisk will set the type to Linux by default. We only need to explicitly set the type of the <span>swap partition: 5 Command (m for help): t Partition number (1-9): 5 Hex code (type L to list codes): 82 Changed system type of partition 5 to 82 (Linux swap) Now we need to set the boot a bl







Flashcard 3814574132492

Question
In linux, the /boot directory (or alternatively, all of the / directory) has to be in the [...] partition
Answer

first

^^ i.e. /dev/sda1


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
beral--most home PCs can do with merely a swap and / partition.). When you install a new server, your distribution should allow you to customize your partitions to match this table. Table 19.1: <span>Which directories should have their own partitions, and their partitions' sizes If another operating system is already installed in the first partition, you can type p and might see: 5 Command (m for help): p Disk /dev/hda: 255 heads, 63 sectors, 788 cylinde







Flashcard 3814577278220

Question
In linux, to bind a directory to a physical device (like a hard disk partition or CD-ROM/USB device) so that the device's file system can be read is called [...] the device.
Answer
mounting

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
C: , D: , etc., notation, of course) is answered here. In UNIX, there is only one root file system that spans many disks. Different directories may actually exist on a different physical disk. <span>To bind a directory to a physical device (like a partition or a CD-ROM) so that the device's file system can be read is called mounting the device. The mount command is used as follows: mount [-t <fstype>] [-o <option>] <device> <directory> umount [-f] [<device>|<directory>] The -t option specifi







Flashcard 3814580948236

Question
In linux, the [...] directory has lots of files (that you can cat) which has kernel/system information like cpu info, memory info, etc.
Answer
/proc

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
Section 42.4. The devpts file system is another pseudo file system that generates terminal master/slave pairs for programs. This is mostly of concern to developers. 19.8 Manually Mounting /proc <span>You can mount the proc file system with the command mount -t proc /proc /proc This is an exception to the normal mount usage. Note that all common LINUX installations require /proc to be mounted at boot time. The only times you will need







Flashcard 3814584093964

Question
In linux, the kernel caches write operations in memory for performance reasons and these are then flushed (physically commit to the hard disk) every so often. Write command to force a flush to disk:
Answer
sync

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
19. Partitions, File Systems, Formatting, Mounting
aches write operations in memory for performance reasons. These flush (physically commit to the magnetic media) every so often, but you sometimes want to force a flush. This is done simply with <span>sync Next: 20. Advanced Shell Scripting Up: rute Previous: 18. UNIX Devices Contents <span>