Skip to content

Instantly share code, notes, and snippets.

@sheshnath08
sheshnath08 / privacy_policy.md
Created April 15, 2020 00:18
Dash Valley III Privacy Policy

Privacy Policy

Sheshnath Yadav built the Dash Valley III app as a Free app. This SERVICE is provided by Sheshnath Yadav at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Dash Valley III unless otherwise defined in this Privacy Policy.

@sheshnath08
sheshnath08 / mac-setup-redis.md
Created April 19, 2019 02:37 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis

Answer #1

Basically it calculates charge amount based on the two seasons, summer or winter. If the date is not in summer,winter_rate is applied and an addition winter_service_charge is also added to amount. If the date is in summer, summer_rate is applied to calculate the charge. It does so with the help of following 3 methods:

  • summer_start which returns summer start date
  • summer_end which returns summer end date
  • calc method, which takes date, charge, quantity, winter_rate, winter_service_charge, summer_rate as parameter and calculate amount based on date
@sheshnath08
sheshnath08 / CalculateNPS.js
Created July 28, 2016 04:34
Calculate NPS Score
function CalculateNPS() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var count = new Array(11);
var d = 0 ;
var n = 0;
var p = 0;
var nps = 0;
var totalRating = 0;
// initializing count array with 0s
@sheshnath08
sheshnath08 / plotDecisionBoundary.m
Created July 19, 2016 13:53
Plot Decision Boundary
function plotDecisionBoundary(theta, X, y)
%PLOTDECISIONBOUNDARY Plots the data points X and y into a new figure with
%the decision boundary defined by theta
% PLOTDECISIONBOUNDARY(theta, X,y) plots the data points with + for the
% positive examples and o for the negative examples. X is assumed to be
% a either
% 1) Mx3 matrix, where the first column is an all-ones column for the
% intercept.
% 2) MxN, N>3 matrix, where the first column is all-ones
@sheshnath08
sheshnath08 / BinarySearch.java
Created July 18, 2016 02:52
Binary Search Implementation In Java
/*
This method accpets a sorted integer array and a key that needs to be searched in the array.
It returns index at which Key is found, if key is not found in the array then it return -1.
*/
public int binarySearch(int nums[],int key){
int low = 0;
int high = nums.length -1;
while(low<=high){
int m = (low+high)/2;
if(key == nums[m]){