Skip to content

Instantly share code, notes, and snippets.

View Vivek-abstract's full-sized avatar
:octocat:
Learning

Vivek Gawande Vivek-abstract

:octocat:
Learning
  • Tata Consultancy Services
  • Mumbai, India
View GitHub Profile
@Vivek-abstract
Vivek-abstract / MinMaxHeap.cs
Created July 5, 2023 14:36
Min Heap and max heap implementation using C#
public class MinHeap
{
public List<int> Heap {get; set;}
public int Count {get; set;}
public MinHeap()
{
Heap = new();
}
@Vivek-abstract
Vivek-abstract / queen_hill_climbing.py
Created December 1, 2018 12:08
Solving the 8-Queen Problem using Hill Climbing Search
import copy
import numpy as np
import chess
import sys
from chess import svg
def exists(i, j):
# Checks if square exists within boundary
@Vivek-abstract
Vivek-abstract / auth.service.ts
Created February 25, 2019 17:03
Google Login in Ionic 4
constructor(private afAuth: AngularFireAuth, private http: HTTP) {
afAuth.authState.subscribe(user => {
this.user = user;
});
}
async signInWithGoogle(user) {
return await this.afAuth.auth.signInAndRetrieveDataWithCredential(
firebase.auth.GoogleAuthProvider.credential(user.idToken)
@Vivek-abstract
Vivek-abstract / generate_receipt.php
Created December 31, 2018 08:20
FPDF Usage in PHP
<?php
require 'fpdf/fpdf.php';
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 13);
// Here's how to display the POST parameters you passed from HTML
$pdf->Cell(0, 0, "Form: " . $_POST['name']);
from __future__ import print_function
from PIL import Image
def encode(image, string_to_encode):
image_data = list(image.getdata())
bin_string = "".join(["{0:08b}".format(ord(c)) for c in string_to_encode])
print("Initial pixel values: ")
print(image_data[:25], end=" ")
print(",....")
print("Enter number of elements: ")
n = int(input())
elements, binary_elements = [], []
for i in range(n):
# Take input and store in array
x = int(input())
elements.append(x)
# Convert to binary array of 8 bits
<ion-header>
<ion-navbar>
<ion-title>Create Post</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
import { Component } from "@angular/core";
import { NavController } from "ionic-angular";
import { Subscription } from "rxjs";
import { finalize } from "rxjs/operators";
import { Geolocation } from "@ionic-native/geolocation";
@Component({
selector: "page-new-post",
templateUrl: "new-post.html"
})
declare module '*';
{
"compilerOptions": {
...
},
"files": [
"types/MicrosoftMaps/CustomMapStyles.d.ts",
"types/MicrosoftMaps/Modules/Autosuggest.d.ts"
],
...
}