Skip to content

Instantly share code, notes, and snippets.

View harshavardhan98's full-sized avatar

P.Harshavardhan harshavardhan98

  • Citi
  • Chennai
View GitHub Profile
Networking:
Books:
Computer Networking: A Top Down Approach
https://designingforperformance.com/
https://book.systemsapproach.org/foundation/problem.html
https://github.com/m4ttsch/omscs-notes-notes/tree/master/computer-networks
https://www.networksfromscratch.com/table_of_contents.html
Tutorials/Blogs:
https://howhttps.works/
import sys
# total arguments
n = len(sys.argv)
print("Total arguments passed:", n)
# Arguments passed
print("\nName of Python script:", sys.argv[0])
print("\nArguments passed:", end = " ")
@harshavardhan98
harshavardhan98 / vanilla-js-cheatsheet.md
Created June 19, 2020 04:39 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@harshavardhan98
harshavardhan98 / 1.java_syntax.java
Last active October 16, 2019 17:56
Security Lab
// import
import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
import java.nio.*;
// I/O
Scanner sc=new Scanner(System.in);
@harshavardhan98
harshavardhan98 / expt
Last active October 8, 2019 06:36
Gcc Lab
Expt 3: java installation
sudo -i
exit
//check proxy
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
java -version
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
public void initGoogleSignIn() {
mAuth = FirebaseAuth.getInstance();
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestIdToken(getString(R.string.default_web_client_id)).requestEmail().build();
GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(fb.this, gso);
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, 111);
@harshavardhan98
harshavardhan98 / BSNL()
Last active August 13, 2019 09:36
Bombit
public void BSNL(String phoneNo,Callback cb) {
OkHttpClient okHttpClient = new OkHttpClient();
String url="https://portal2.bsnl.in/myportal/validatemobile.do";
String referer_url = "https://portal2.bsnl.in/myportal/authorize.do";
MediaType parse = MediaType.parse("application/x-www-form-urlencoded");
okHttpClient.newCall(new Request.Builder().url(url)
.post(RequestBody.create(parse,"mobile=" + phoneNo))
@harshavardhan98
harshavardhan98 / Contact.java
Last active August 5, 2019 15:28
List View - Contains code to implement a list view with custom Adapter
public class Contact {
String name;
String message;
String dpUrl;
String time;
public Contact(String name, String message, String dpUrl, String time) {
this.name = name;
this.message = message;
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:padding="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:text="hellp"
@harshavardhan98
harshavardhan98 / binary_search.cpp
Created March 24, 2019 06:15
cp code snippets
//https://stackoverflow.com/a/39100135/10664312
int bs_upper_bound(int a[], int n, int x) {
int l = 0;
int h = n; // Not n - 1
while (l < h) {
int mid = (l + h) / 2;
if (x >= a[mid]) {
l = mid + 1;
} else {