Skip to content

Instantly share code, notes, and snippets.

View a7r3's full-sized avatar
👩‍💻
<- All day, all night

Arvindraj a7r3

👩‍💻
<- All day, all night
View GitHub Profile
@a7r3
a7r3 / meh.sh
Last active October 8, 2018 04:19
meh
# default: on
# description: The telnet server serves telnet sessions; it uses
# unencrypted username/password pairs for authentication.
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
create table instructor_audit(
id char(5) NOT NULL,
entry_date TEXT NOT null
);
create function insert_audit() returns trigger as $pgfunc$
begin
insert into instructor_audit(id, entry_date) values(new.id, current_timestamp);
return new;
end;
select id from instructor where id not in (select id from teaches)
select building, sum(capacity) from classroom group by building
-- We create a virtual relation which is called a 'View'
-- Here, a virtual relation v1 is created which holds
-- the result of the select query which follows
create view v1 as select count(*) as c1 from teaches t1 group by course_id, sec_id
-- We then query the virtual relation, to get the maximum count
set ns [new Simulator]
$ns color 1 Blue
$ns color 2 Red
set nf [open out.nam w]
$ns namtrace-all $nf
# Standard procedure
create table employee(emp_id CHAR(5) PRIMARY KEY,emp_name varchar(15),job_name varchar(10),manager_id CHAR(5),hire_date date ,salary int,comm int,deptid char(4));
insert into employee values ('66928','BLAZE','MANAGER','68319','1991-05-01',2750,0,'3001');
insert into employee values ('67832','CLARE','MANAGER','68319','1991-06-09',2550,0,'1001');
insert into employee values ('65646','JONAS','MANAGER','68319','1991-04-02',2957,0,'2001');
insert into employee values ('64989','ADELYN','SALESMAN','66928','1991-02-20',1700,400,'3001');
insert into employee values ('65271','WADE','SALESMAN','66928','1991-09-28',1350,600,'3001');
insert into employee values ('66564','MADDAN','SALESMAN','66928','1991-09-08',1600,0,'3001');
insert into employee values ('68454','TUCKER','SALESMAN','66928','1991-02-22',1600,0,'3001');
insert into employee values ('68736','ADNRES','CLERK','67858','1997-05-23',1200,0,'2001');
@a7r3
a7r3 / AndroidRes.md
Last active March 7, 2023 07:27
@AndroidRes
-- Dropping the table 'courses' if it exists
DROP TABLE IF EXISTS courses;
-- Creates table 'courses' with the specified attributes and their respective datatype
CREATE TABLE courses(course_no INT PRIMARY KEY, course_name TEXT);
-- ALTER = Alters the Data Definition of a Table
-- Adding a column 'course_credits'
ALTER TABLE courses ADD course_credits INT;
@a7r3
a7r3 / hamming.c
Last active July 16, 2018 05:29
TODO: Make it Dynamic (n-bit hamming code)
#include<stdio.h>
#include<conio.h>
/*
Hamming Code (4-Bit)
____________________________________
| D6 | D5 | D4 | P3 | D2 | P1 | P0 |
------------------------------------
@a7r3
a7r3 / gui.py
Created April 21, 2018 09:20
TkinterStuffs
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
class Form:
def __init__(self, master):
self.master = master
master.title("Exam Form")
@a7r3
a7r3 / numbers.h
Created April 14, 2018 18:31
CG2048.Extras()
int zero[5][5] = {
{0, 0, 1, 0, 0},
{0, 1, 0, 1, 0},
{0, 1, 0, 1, 0},
{0, 1, 0, 1, 0},
{0, 0, 1, 0, 0}
};
int one[5][5] = {
{0, 0, 1, 0, 0},