Skip to content

Instantly share code, notes, and snippets.

View gambitier's full-sized avatar
🏆
Open for collaboration

Akash Jadhav gambitier

🏆
Open for collaboration
View GitHub Profile
using System;
using EnumExtensions;
namespace EnumExtensions
{
using System;
using System.Reflection;
public class TextAttribute : Attribute
{
public string runProcess(string cmdName, string cmdArgs, string cmdPath)
{
   string myProcOutput = "";
   try
   {
      Process myproc = new Process();
      myproc.StartInfo.UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
      myproc.StartInfo = new ProcessStartInfo("cmd.exe");
      myproc.StartInfo.LoadUserProfile = true;
@gambitier
gambitier / s3download_promise.js
Created February 1, 2022 09:06 — forked from milesrichardson/s3download_promise.js
S3 download promise: nodeJS promise to download file from amazon S3 to local destination
const AWS = require('aws-sdk');
const fs = require('fs')
const s3download = (bucketName, keyName, localDest) => {
if (typeof localDest == 'undefined') {
localDest = keyName;
}
let params = {
@gambitier
gambitier / npAlgoTheory.md
Created December 25, 2019 08:37
Welcome file

P and NP Class Algorithms

Problem Types

  • Optimization Problems
  • Decision Problems

C++ Program to Implement Queue using Array

Queue implements the FIFO mechanism


#include <iostream>
using namespace std;
int queue[100], n = 100, front = - 1, rear = - 1;

Stack Data Structure

Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out)

Implementation:
There are two ways to implement a stack:

  • Using array
  • Using linked list

Linked List Data Structure

enter image description here

A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations.

The elements in a linked list are linked using pointers as shown in the image:

Binary Tree | (Properties)

binary tree is a non-linear data structure in which each node has maximum of two child nodes. The tree connections can be called as branches.

Properties

refer more here

1) The maximum number of nodes at level ‘l’ of a binary tree is 2l-1

Palindrome

integer palindrome

If the reversed integer is equal to the integer entered by user then, that number is a palindrome if not that number is not a palindrome.

#include <iostream>
using namespace std;
int main()
{

ASP.Net MVC: Session

Web applications work on HTTP protocol and HTTP is a stateless protocol. Every HTTP request is treated as an independent request. The Server does not have knowledge about the variable values, which are being used in the previous request

Session is a temporary memory location where we can hold small amount of data for a certain period of time during user visit on any website, Session is a HttpSessionStateBase object.

Session is derived from the HttpSessionStateBase class and is used for persisting data i.e. State Management across requests in ASP.Net MVC Razor.

What is Session