Skip to content

Instantly share code, notes, and snippets.

View hr1383's full-sized avatar

harshit rastogi hr1383

View GitHub Profile
@hr1383
hr1383 / widgets.json
Created March 8, 2018 19:14
widgets.json
{
"_id": {
"$oid": "5a3eae93734d1d12b6754044"
},
"business": "kree photography",
"website": "http://www.kreephotography.com/",
"widgets": [{
"yelp": {
"url": "https://www.yelp.com/biz/kree-photography-pleasanton-3",
"average_review": "4.3",
@hr1383
hr1383 / test.cpp
Last active December 7, 2015 06:02
change this
for (count; count < arraySize-1; count++) {
for (secondCounter = count + 1; secondCounter < arraySize; secondCounter++) {
if (rec[count].salary > rec[secondCounter].salary) {
temp = rec[count].salary;
rec[count].salary = rec[secondCounter].salary;
rec[secondCounter].salary = temp;
}
}
}
@hr1383
hr1383 / test.cpp
Last active December 3, 2015 05:47
void payrollProcess(double & hoursWorked, double & hourlyWage, double & grossPay, double & FITW_Exemptions, double & ficaTaxAmt, int & exemptionsQty, char & maritalStatus, double & totalExemptions) {
int maxHours = 40;
double overtimeHours = 0, adjustedIncome = 0;
bool error = false;
// calculating overtime hours
if (hoursWorked > maxHours) {
overtimeHours = hoursWorked - maxHours;
}
@hr1383
hr1383 / algo_recursive_sent.java
Created April 20, 2015 04:39
Given a list of word lists How to print all sentences possible taking one word from a list at a time via recursion
// Given a list of word lists How to print all sentences possible taking one word from a list at a time via recursion
// http://www.geeksforgeeks.org/recursively-print-all-sentences-that-can-be-formed-from-list-of-word-lists/
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class RecursiveList {
public static void main(String[] args) {
List<String> l1 = Arrays.asList(new String[]{"you","are"});
@hr1383
hr1383 / algo_transformword.rb
Last active August 29, 2015 14:19
transform on word to other with intermediate words in dictionary, with min steps
# Given a source word, target word and an English dictionary, transform the source word to target by
# changing/adding/removing 1 character at a time, while all intermediate words being valid English words.
# Return the transformation chain which has the smallest number of intermediate words.
# - See more at: http://www.ardendertat.com/2011/10/17/programming-interview-questions-8-transform-word/
#this is pseudo code, untested
dict = Hash.new
build_dict(dict_arr)
@hr1383
hr1383 / README.md
Last active August 29, 2015 14:00
Connecting the dots among companies invested by different VC's using D3.js

Grabbed the data of leading VC's in silicon valley using Crunchbase API.

The VC's data collected :

  1. Accel Partners
  2. Andersson Horowitz 3)General Catalyst 4)Greylock
  3. Klien Partners