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
@gambitier
gambitier / cuda_9.0_cudnn_7.0.sh
Created August 13, 2018 18:27 — forked from ashokpant/cuda_9.0_cudnn_7.0.sh
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
bundler init
# edit Gemfile by adding..
==> gemm "rspec"
bundle install
bundle exec rspec --init
# create lib directory and add myClass.rb file to put ruby classes
@gambitier
gambitier / ruby_tests.rb
Last active December 27, 2019 13:15 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
## From Lynda.com course 'RSpec Testing Framework with Ruby'
describe 'Expectation Matchers' do
describe 'equivalence matchers' do
it 'will match loose equality with #eq' do
a = "2 cats"
b = "2 cats"
expect(a).to eq(b)
@gambitier
gambitier / cuda_installation_on_ubuntu_18.04
Created January 11, 2019 11:19 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@gambitier
gambitier / augumented_hdf5_matrix.py
Created April 14, 2019 09:18 — forked from wassname/augumented_hdf5_matrix.py
How to do data augmentation on a keras HDF5Matrix
"""Another way, note this one will load the whole array into memory ."""
from keras.preprocessing.image import ImageDataGenerator
import h5py
from keras.utils.io_utils import HDF5Matrix
seed=0
batch_size=32
# we create two instances with the same arguments
data_gen_args = dict(
rotation_range=90.,

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

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()
{

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

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:

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