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 / Advanced Topics.md
Last active October 24, 2024 04:20
Computer Architecture Notes | Generated using ChatGPT + Publicly available lecture notes (NPTEL Multicore computer architecture)

Let’s go into extreme detail on each of these topics, focusing on how they work, their key principles, and their impact on system performance.


1. Cache Memory

Cache memory is a small, high-speed memory located close to the CPU that stores frequently accessed data and instructions. Its purpose is to reduce the time it takes for the CPU to access data from slower main memory (RAM), enhancing overall system performance.

Key Components and Structure:

  • Cache Levels: Modern systems implement multiple levels of cache (L1, L2, L3):
@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.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 / 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 / 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 / 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.