Skip to content

Instantly share code, notes, and snippets.

View RajaniCode's full-sized avatar

Rajani RajaniCode

View GitHub Profile
@RajaniCode
RajaniCode / H2
Created December 17, 2019 04:05
H2
## H2 Server
$ java -cp h2-1.4.193.jar org.h2.tools.Server -baseDir /e/Working/SQL/H2/Java/H2-Base -properties /e/Working/SQL/H2/Java/H2-Base
# OR
$ java -cp h2-1.4.193.jar org.h2.tools.Console -baseDir /e/Working/SQL/H2/Java/H2-Base -properties /e/Working/SQL/H2/Java/H2-Base
http://192.168.56.1:8082/login.jsp?jsessionid=127e3c922687e2a50c5750ac4fbb894c
Saved Settings:
Generic H2 (Embedded)
Setting Name:
Generic H2 (Embedded)
Driver Class:
@RajaniCode
RajaniCode / HSQLDB
Created December 17, 2019 04:09
HSQLDB
## Git Bash ## Create Database
$ java -version
$ cd "E:\Working\SQL\HSQLDB"
$ unzip hsqldb-2.3.4.zip
## Create Database
@RajaniCode
RajaniCode / SQLite
Created December 17, 2019 04:13
SQLite
-- Command Line
>sqlite3 -version
3.8.7.2 2014-11-18 20:57:56 2ab564bf9655b7c7b97ab85cafc8a48329b27f93
-- OR
>sqlite3 --version
3.8.7.2 2014-11-18 20:57:56 2ab564bf9655b7c7b97ab85cafc8a48329b27f93
> sqlite3
sqlite> .quit
-- OR
sqlite> .q
@RajaniCode
RajaniCode / PySpark
Last active December 17, 2019 06:00
PySpark
./spark-1.6.1/bin/pyspark --conf "spark.mongodb.input.uri=mongodb://127.0.0.1/nasa.eva?readPreference=primaryPreferred" \
--conf "spark.mongodb.output.uri=mongodb://127.0.0.1/nasa.astronautTotals" \
--packages org.mongodb.spark:mongo-spark-connector_2.11:2.0.0
# SparkContext available as sc, HiveContext available as sqlContext.
>>> dir(sc)
['PACKAGE_EXTENSIONS', '__class__', '__delattr__', '__dict__', '__doc__', '__enter__', '__exit__', '__format__', '__getattribute__', '__getnewargs__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_accumulatorServer', '_active_spark_context', '_batchSize', '_callsite', '_checkpointFile', '_conf', '_dictToJavaMap', '_do_init', '_ensure_initialized', '_gateway', '_getJavaStorageLevel', '_initialize_context', '_javaAccumulator', '_jsc', '_jvm', '_lock', '_next_accum_id', '_pickled_broadcast_vars', '_python_includes', '_temp_dir'
@RajaniCode
RajaniCode / Spark
Last active December 17, 2019 06:01
Spark
/***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
#Master WTJavaTask
Aspire@Acer MINGW64 ~
$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
@RajaniCode
RajaniCode / Hadoop
Last active December 17, 2019 06:02
Hadoop
##MapReduce #Word Count
#inputmap.txt
A long time ago
in a galaxy far
far away
@RajaniCode
RajaniCode / CS2.cs
Last active December 17, 2019 06:05
CS2
// CS 2
/*
1. Generics
2. Nullable types
3. Iterators
4. yield Statement
5. Partial Classes/Structs/Interfaces
6. Anonymous methods
7. The :: operator (Namespace Alias Qualifier)
8. Static Classes
@RajaniCode
RajaniCode / CS3.cs
Last active December 17, 2019 06:05
CS3
// CS 3
/*
1. Implicitly Typed Local Variables
2. Implicitly Typed Arrays
3. Query Expressions (LINQ)
4. Anonymous Types
5. Object and Collection Initializers
6. Extension Methods
7. Lambda Expressions
8. Expression Trees
@RajaniCode
RajaniCode / LINQ.cs
Last active December 17, 2019 06:06
LINQ
// LINQ
using System; 
using System.Linq;  
using System.Collections;
using System.Collections.Generic;     
class Query
{
public void Print()
@RajaniCode
RajaniCode / CS4.cs
Last active December 17, 2019 06:06
CS4
// CS 4
/*
1. Dynamic Binding
2. Optional Parameters
3. Named Arguments
4. Variance - Covariance and Contravariance
5. Tuple
*/
using System;