This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import difflib | |
from shutil import copyfile | |
import pathlib | |
if len(sys.argv) < 3: | |
print('[ERR]: Not enough arguments passed. Usage: get_diff.py <firstFolder> <secondFolder>') | |
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import mysql.connector | |
import time | |
mydb = mysql.connector.connect( | |
host="your_db_host", | |
user="db_user", | |
password="*****", | |
database="db_name" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IPv4: | |
@staticmethod | |
def dec_to_binary(address): | |
return list(map(lambda x: bin(x)[2:].zfill(8), address)) | |
@staticmethod | |
def negation_mask(net_mask): | |
wild = list() | |
for i in net_mask: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import threading | |
import time | |
import json | |
import random | |
import hashlib | |
import os | |
sent_flag = [] # if timeout make sent_flag in window = 0; | |
ACK_num = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import threading | |
import time | |
import json | |
import random | |
import hashlib | |
import os | |
threshold = 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Function | |
--compile first | |
SET SERVEROUTPUT ON; | |
CREATE OR REPLACE FUNCTION PROC_GRADE_FUN(MARKS IN NUMBER,NAME_ IN VARCHAR2, ROLL_ IN NUMBER) | |
RETURN VARCHAR2 IS | |
RESULT VARCHAR2(50); | |
BEGIN | |
IF(MARKS >= 990 AND MARKS <= 1500)THEN | |
RESULT := 'DISTINCTION'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET SERVEROUTPUT ON; | |
DECLARE | |
NAME_OF_BOOK_ VARCHAR(50); | |
ROLL_NUMBER_ NUMBER; | |
CURRENT_DATE DATE; | |
DATE_OF_ISSUE_ DATE; | |
NUMBER_OF_DAY NUMBER; | |
STATUS_ VARCHAR2(1); | |
FINE_AMOUNT NUMBER := 0; | |
STATUS_CHECKUP EXCEPTION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> use students; | |
Reading table information for completion of table and column names | |
You can turn off this feature to get a quicker startup with -A | |
Database changed | |
mysql> select * from EMPLOYEE; | |
+--------+------------+-----------+------------+--------+-----------+------------+---------+ | |
| EMP_ID | FIRST_NAME | LAST_NAME | HIRE_DATE | SALARY | JOB_TITLE | MANAGER_ID | DEPT_ID | | |
+--------+------------+-----------+------------+--------+-----------+------------+---------+ | |
| 1 | GANESH | SINGH | 2015-02-01 | 50000 | MANAGER | 4 | 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> CREATE DATABASE ASSIGNMENT3; | |
Query OK, 1 row affected (0.01 sec) | |
mysql> USE ASSIGNMENT3; | |
Reading table information for completion of table and column names | |
You can turn off this feature to get a quicker startup with -A | |
Database changed | |
mysql> SELECT * FROM EMPLOYEE; | |
+--------+------------+-----------+--------+--------------+------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.UnknownHostException; | |
import java.util.Scanner; | |
import com.mongodb.*; | |
public class DatabaseConnectivity { | |
private static void choice_input(){ | |
System.out.println("\n1.insert data into database\n2.update database documents\n3.delete database documents\n4.show database collections\n5.Exit"); | |
} | |
public static void main(String[] args) { | |
String key, value; |
NewerOlder