Skip to content

Instantly share code, notes, and snippets.

View docsallover's full-sized avatar

DocsAllOver docsallover

View GitHub Profile
@docsallover
docsallover / single_object.java
Created August 28, 2025 10:50
Example of a simple Box class that can hold any single object in java
public class Box<T> {
private T t; // T is a placeholder for the type of object the box holds
public void set(T t) {
this.t = t;
}
public T get() {
return t;
}
@docsallover
docsallover / genericsexample.java
Created August 24, 2025 15:30
The "After" (With Generics) In Java
import java.util.ArrayList;
import java.util.List;
public class GenericsExample {
public static void main(String[] args) {
// Create a type-safe List using generics
List<String> list = new ArrayList<String>();
// Add a String
list.add("Hello, World!");
@docsallover
docsallover / Pregenericsexample.java
Created August 24, 2025 15:28
The "Before" (Pre-Generics) In Java
import java.util.ArrayList;
public class PreGenericsExample {
public static void main(String[] args) {
// Create a raw ArrayList (no specified type)
ArrayList list = new ArrayList();
// Add a String and an Integer to the same list
list.add("Hello, World!");
list.add(123); // The compiler allows this!
@docsallover
docsallover / Transformation_etl.hql
Last active August 28, 2025 10:50
Transformation (ETL) in HiveQL
INSERT OVERWRITE TABLE monthly_page_views
PARTITION (year, month)
SELECT
page_view,
COUNT(*) AS view_count,
YEAR(FROM_UNIXTIME(request_timestamp)) AS year,
MONTH(FROM_UNIXTIME(request_timestamp)) AS month
FROM raw_web_logs
GROUP BY
page_view,
@docsallover
docsallover / exploratory_analysis.hql
Last active August 28, 2025 10:51
Exploratory Analysis in HiveQL
SELECT
page_view,
COUNT(*) AS page_views
FROM raw_web_logs
GROUP BY page_view
ORDER BY page_views DESC
LIMIT 10;
@docsallover
docsallover / define_schema.hql
Last active August 28, 2025 10:51
Define a schema in HiveQL
CREATE EXTERNAL TABLE IF NOT EXISTS raw_web_logs (
request_timestamp BIGINT,
ip_address STRING,
user_agent STRING,
page_view STRING
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/data/raw/weblogs/';
@docsallover
docsallover / hiveqlc_code.hql
Last active August 28, 2025 10:52
HiveQL code to create a table and query data
-- Create a table with a schema
CREATE TABLE IF NOT EXISTS web_logs (
timestamp BIGINT,
ip_address STRING,
user_agent STRING,
page_view STRING
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE;
@docsallover
docsallover / simple_counter_home.vue
Last active August 28, 2025 10:52
A Simple Counter In Vue.js
<template>
<div>
<h1>Welcome to the Home Page</h1>
<p>This is the main content of our single-page application.</p>
<hr>
<h2>A Simple Counter</h2>
<p>Current count: {{ count }}</p>
<button @click="increment">Increment</button>
@docsallover
docsallover / app.vue
Created August 12, 2025 08:59
Including the navigation links and the router view
<template>
<nav>
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</nav>
<router-view></router-view>
</template>
<script setup>
</script>
@docsallover
docsallover / main.js
Created August 12, 2025 08:57
Importing & Using Router
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
createApp(App).use(router).mount('#app')