Skip to content

Instantly share code, notes, and snippets.

View theArjun's full-sized avatar

Arjun Adhikari theArjun

View GitHub Profile
@theArjun
theArjun / MString.java
Created January 26, 2020 12:12
New String Data Type
import java.lang.String;
// import java.util.Arrays;
public class MString {
private char[] theChars;
private int n;
private void expand(int mustHaveCapacity) {
char[] temp = new char[2 * mustHaveCapacity];
System.out.println("Temp size : " + temp.length);
@theArjun
theArjun / prog1.asm
Last active December 24, 2019 06:19
SIC Program Execution
prog START 1000
LDA FIVE
ADD ONE
STA ALPHA
ALPHA RESW 1
FIVE WORD 5
ONE WORD 1
END
@theArjun
theArjun / OUTPUT.md
Last active August 17, 2019 03:53
Check the Execution Time Period of SQL Queries

The output of the above query was :

query_executiontime

Hence, it can be concluded that sub query takes more time to execute than the normal SQL query.

@theArjun
theArjun / NestedSwitch.java
Created June 17, 2019 16:29
Nested Switch Implementation in Java
class NestedSwitch {
public static void main(String[] args) {
// Necessary Condition
int num1 = 100;
// Supplement Condition
int num2 = 221;
// Necessary Switch
@theArjun
theArjun / add_two_numbers_from_keyboard.asm
Created May 27, 2019 14:11
Add Two numbers from keyboard in 8086
.model small
.stack 100h
.data
first db 10,13, "Enter first character : $"
second db 10,13, "Enter second character : $"
output db 10,13, "The output is : $"
.code
main proc
@theArjun
theArjun / wiggle_walk.py
Last active May 26, 2019 15:12
Wiggle Walk - Google Kickstart
num = int(input())
result = {}
for i in range(num):
n, r, c, sr, sc = list(map(int, input().rstrip().split()))
instructions = list(input().rstrip())
visited = list()
visited.append((sr, sc))
@theArjun
theArjun / _OUTPUT.md
Last active May 25, 2019 01:43
Lowest Fraction Possible for a Floating point number

Output

@theArjun
theArjun / _UpdateManagerSalary.java
Last active May 13, 2019 11:17
Update Manager Salary
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class UpdateManagerSalary {
private static final String JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
private static final String JDB_URL = "jdbc:mysql://localhost:3306/testdb";
@theArjun
theArjun / IsInternetAvailable.java
Created May 13, 2019 03:32
Checks if internet is Available on PC
/* This program checks whether your device is connected to Internet or not. */
import java.net.InetSocketAddress;
import java.net.Socket;
/**
* @author arjun
*/
public class IsInternetAvailable {
public static void main(String[] args) {
@theArjun
theArjun / ABOUT.md
Last active May 19, 2019 15:04
Classic Cookie Challenge

Classic Cookie Challenge

It's a common challenge mostly seen in interviews in bigger tech companies for hiring.
In this solution done by me, it's referenced according to the video.

Cookie Challenge