This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ********************************** Quick Sort *********************************************** | |
* UNSORTED ARRAY [3, 7, 8, 5, 2, 1, 9, 6, 4] | |
* pivot ^ | |
* pivot: 3 arr: [ 2, 1, 3, 5, 8, 7, 9, 6, 4 ] | |
* [2, 1] [5, 8, 7, 9, 6, 4 ] | |
* pivot ^ ^ | |
* pivot: 2 arr: [ 1, 2 ] | |
* pivot: 5 arr: [ 4, 5, 7, 9, 6, 8 ] | |
* [ 4] [7, 9, 6, 8 ] --> Array with single element is sorted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var log4js = require('log4js'); | |
var logger = log4js.getLogger('Helper'); | |
logger.setLevel('DEBUG'); | |
var path = require('path'); | |
var util = require('util'); | |
var hfc = require('fabric-client'); | |
hfc.setLogger(logger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ********************************** Quick Sort *********************************************** | |
* UNSORTED ARRAY [3, 7, 8, 5, 2, 1, 9, 6, 4] | |
* pivot ^ | |
* pivot: 3 arr: [ 2, 1, 3, 5, 8, 7, 9, 6, 4 ] | |
* [2, 1] [5, 8, 7, 9, 6, 4 ] | |
* pivot ^ ^ | |
* pivot: 2 arr: [ 1, 2 ] | |
* pivot: 5 arr: [ 4, 5, 7, 9, 6, 8 ] | |
* [ 4] [7, 9, 6, 8 ] --> Array with single element is sorted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ************************************************ MERGE SORT ***************************************************** | |
* | |
* [38, 27, 43, 3, 9, 82, 10, 900, 78, 80, 11] | |
* / \ | |
* [38, 27, 43, 3, 9, 82] [10, 900, 78, 80, 11] | |
* / \ / \ | |
* [38, 27, 43] [3, 9, 82] [10, 900, 78] [ 80, 11 ] | |
* / \ / \ / \ / \ | |
* [38, 27] [ 43 ] [3, 9] [ 82 ] [10, 900] [ 78 ] [ 80 ] [ 11 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pee = (effHrs, effMins, lastInHrs, lastInMins, avgHrs, avgMins) => { | |
let totalEffMins = effHrs * 60 + effMins; | |
let avg = avgHrs * 60 + avgMins; | |
let diffInMins; | |
let leaveHrs; | |
let leaveMins; | |
const currentTime = new Date().toLocaleTimeString({ | |
timeZone: "Asia/Kolkata" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const peeTimeCalculator = ( | |
currentEffHr, | |
currentEffMins, | |
lastInHr, | |
lastInMins, | |
avgHrs = 7, | |
avgMins = 0 | |
) => { | |
let totalMins = currentEffHr * 60 + currentEffMins; | |
let lastLogin = lastInHr * 60 + lastInMins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import axios from "axios"; | |
import { Card, Header, Form, Input, Icon } from "semantic-ui-react"; | |
let endpoint = "http://localhost:8080"; | |
class ToDoList extends Component { | |
constructor(props) { | |
super(props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package router | |
import ( | |
"../middleware" | |
"github.com/gorilla/mux" | |
) | |
// Router is exported and used in main.go | |
func Router() *mux.Router { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package middleware | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"../models" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Styles from this codepen: | |
https://codepen.io/official_naveen/pen/rgknI | |
*/ | |
body { |