Skip to content

Instantly share code, notes, and snippets.

View laughingclouds's full-sized avatar
:octocat:
idk

Hemant Bhandari laughingclouds

:octocat:
idk
  • Chandigarh, India
View GitHub Profile
@laughingclouds
laughingclouds / exp1.2q3.sql
Last active November 14, 2022 07:56
DBMS | CSH-214
-- Create tables for the college database
BEGIN;
CREATE TABLE IF NOT EXISTS public.departments
(
id integer NOT NULL,
name character varying NOT NULL,
hod character varying NOT NULL,
@laughingclouds
laughingclouds / setupCommands.sh
Created October 3, 2022 04:43
Oracle DB Docker Initial Setup
# docker container initialization
docker run --name oracle-xe-21c \
-d -p 1521:1521 \
-e ORACLE_PASSWORD=x \
-v /mnt_point/oradata:/home/oracle/oradata \
gvenzl/oracle-xe
# connecting to container
docker exec -ti oracle-xe-21c sqlplus / as sysdba
import java.io.IOException;
import java.util.Iterator;
import java.util.zip.*;
/**
* Main
*/
public class Main {
public static void main(String[] args) throws IOException {
@laughingclouds
laughingclouds / exp1.1.cpp
Last active August 27, 2022 07:10
21BCS3268 | CSH-211 | Unit 1 practicals
/*menu driven program to implement various operations on a linear array*/
#include <iostream>
#define MAX_CAPACITY 10
int arr[MAX_CAPACITY];
unsigned int len = 0;
/**
1) shift elements to the right
2) insert element at position
@laughingclouds
laughingclouds / AboutComponent.js
Last active July 13, 2022 17:30
Coursera React Course | Assignment 2-3 | Solution
import { Breadcrumb, BreadcrumbItem, Card, CardBody, CardHeader, Media } from 'reactstrap';
import { Link } from 'react-router-dom';
import RenderLeaders from './RenderLeaders';
export default function About(props) {
return (
<div className="container">
<div className="row">
@laughingclouds
laughingclouds / Reasoning.md
Last active April 29, 2022 06:43
User defined header file example

Here, add() and printStudent() are user defined functins defined in file second.c.

We are using the functions defined in second.c in the file first.c.

For that, we use the header file new.h. It will contain declaration of add and printStudent, but the definition will be in second.c.

After defining the functions in new.h we include the header file in first.c.

@laughingclouds
laughingclouds / pattern.go
Last active February 5, 2022 11:45
Pattern Printing In 5 languages | Go | Java | Python | Ruby | TypeScript
/*
go version go1.17 linux/amd64
RUN CODE HERE https://go.dev/play/
simply copy and paste -> click "run"
*/
package main
import (
"fmt"
"strings"
@laughingclouds
laughingclouds / reverse.c
Created December 9, 2021 09:45
Reverse a string in C
#include <stdio.h>
#include <string.h>
void strrev(char *str, char *nStr) {
int len = strlen(str);
for (int i = len - 1; i >= 0; i--) {
strncat(nStr, &str[i], 1);
}
@laughingclouds
laughingclouds / selfPurge.js
Created December 8, 2021 20:49
Purge all your comments from reddit
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function clickDeleteFromSelection(selectedNode) {
for (let childNode of selectedNode.anchorNode.childNodes) {
if (childNode.innerText == "Delete") {
childNode.click();
}
}
}
@laughingclouds
laughingclouds / Makefile
Last active October 20, 2021 21:18
Recursively remove all the files that don't have the specified extension.
# Better than the rest, a frickin' makefile!
# https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
CC=gcc
CFLAGS=-I.
DEPS = header_file.h
OBJ = file1.c file2.c and_so_on.c
%.o: %.c $(DEPS) # for compiling the object code
$(CC) -c -o $@ $< $(CFLAGS)