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 strA = 'abcdeaa'; | |
var strB = '002bcdekk'; | |
//approach from https://www.geeksforgeeks.org/print-longest-common-substring/ | |
var maxCommonString = (strA, strB)=>{ | |
var trail = [[],[]]; | |
var cur = 0; | |
var maxLength = 0; | |
var posA = 0; | |
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 a = [1, 2, 3,4,5] | |
function getIndexofMaxOfArray(array, compareFunction) { | |
if(! Array.isArray(array)) return -1; | |
if(array.length === 0) return -1; | |
var pos = 0; | |
for(var i = 1; i<array.length; i++ ){ | |
if(typeof compareFunction === 'function'){ |
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 strA = 'ACBDEA'; | |
var strB = 'ABCDA'; | |
//approach from https://algorithms.tutorialhorizon.com/dynamic-programming-longest-common-subsequence/ | |
var longestCommonSubsequenceLength = (strA, strB)=>{ | |
var LCS = [[],[]]; | |
var cur = 0; | |
var maxLength = 0; | |
for(var i=0; i <= strA.length; 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
var big_multiply = function(a,b){ | |
a += '', b += ''; //int to string | |
var c = []; | |
c.length = a.length + b.length; | |
for(var index= 0; index<c.length; index++){ | |
c[index] = 0; | |
} | |
for(var index_b = 1; index_b <= b.length; index_b++){ |
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
for(var n=4;n<10000;n++){ | |
var b = n*n + ''; | |
for(var i=1;i<b.length;i++){ | |
var part1 = + b.substring(0,i), part2 = + b.substring(i); | |
if(part1 + part2 === n){ | |
console.log(`${n}^2 = ${b} ${part1} + ${part2} = ${n}`); | |
} | |
} | |
} |
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
let create_leak_class = () => { | |
function Leak() { | |
//call an unused prototype method | |
this.unused(); | |
} | |
Leak.prototype.unused = () => { |
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 loadPage = async (n) => { | |
var response = await fetch(`https://www.tecmint.com/free-open-source-cloud-storage-tools-for-linux/${n}/`); | |
var html = await response.text(); | |
var $ = jQuery; | |
var entry = $('article .entry-inner', html); | |
entry.find('.social-sharing').remove(); | |
entry.find('img[data-lazy-src]').each(function () { |
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 content = '社会主义核心价值观的基本内容是:富强、民主、文明、和谐,自由、平等、公正、法治,爱国、敬业、诚信、友善。'; | |
var sizeOfLine = 20; | |
var count = 0; | |
var isOdd = true; | |
var output = ''; | |
var oddLine = [], evenLine = []; | |
var Harray = []; | |
var isVertical = false; |
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
************************************************************** | |
* FUNCTION * | |
************************************************************** | |
undefined __fastcall FUN_00401420(CWnd * param_1) | |
undefined AL:1 <RETURN> | |
CWnd * ECX:4 param_1 | |
undefined4 Stack[-0x4]:4 local_4 XREF[2]: 0040146e(W), | |
004017fc(W) | |
undefined1 Stack[-0x8]:1 local_8 XREF[8]: 004014c8(W), | |
004014d6(W), |
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
"use strict"; | |
const http = require('http'); | |
const url = require('url'); | |
const { exec } = require('child_process'); | |
let listenPort = 8081; | |
let startHttpServer = function(){ | |
http.createServer(function(req, res) { |