This file contains hidden or 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
using System; | |
using System.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Moq; | |
using Moq.Protected; | |
namespace Tests | |
{ | |
public class MockHttpClient |
This file contains hidden or 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
{ | |
"logstash-2015.05.18": { | |
"mappings": { | |
"log": { | |
"properties": { | |
"@message": { | |
"type": "text", | |
"fields": { | |
"keyword": { | |
"type": "keyword", |
This file contains hidden or 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
{ | |
"logstash-2015.05.18": { | |
"mappings": { | |
"log": { | |
"properties": { | |
"@message": { | |
"type": "text", | |
"fields": { | |
"keyword": { | |
"type": "keyword", |
This file contains hidden or 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
var express = require("express"); | |
var app = express(); | |
var path = require("path"); | |
app.get('/',function(req,res){ | |
res.sendFile(path.join(__dirname+'/index.html')); | |
//__dirname : It will resolve to your project folder. | |
}); |
This file contains hidden or 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 TheAlgorithmDesignManual.AaaIntroduction; | |
public class insertion_sort_class { | |
public void insertion_sort(int[] s, int n) { | |
// counters | |
int i, j; | |
for (i = 1; i < n; i++) { | |
j = i; | |
while ((j > 0) && (s[j] < s[j - 1])) { |
This file contains hidden or 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
// https://stackoverflow.com/questions/7537791/understanding-recursion-to-generate-permutations/50382627#50382627 | |
let str = "ABC"; | |
permute(str, 0, str.length - 1, 0); | |
function permute(str, left, right, depth) { | |
if (left === right) { | |
console.log("PRINT:", str + "\n"); | |
} else { | |
for (let i = left; i <= right; i++) { |
This file contains hidden or 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
// https://www.youtube.com/watch?v=5cPbNCrdotA | |
// we are trying to find next higher value | |
struct Node | |
{ | |
int data; | |
struct Node *left; | |
struct Node *right; | |
} | |
// function to find In order successor in a BST |
This file contains hidden or 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
/** Algorithm: given a collection (matrix) of | |
pixels you must find the size of the largest shape. | |
Shapes were defined as pixels touching each other orthogonality. */ | |
var input = [ | |
[1, 1, 1, 1, 0], | |
[1, 1, 0, 1, 0], | |
[1, 1, 0, 0, 0], | |
[0, 0, 0, 0, 0] | |
]; | |
var input2 = [ |
This file contains hidden or 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
struct BstNode | |
{ | |
int data; | |
BstNode *left; | |
BstNode *right; | |
}; | |
int FindMin(BstNode *root) | |
{ | |
if (root == NULL) |
NewerOlder