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
jQuery(function($){ | |
var ajaxurl = load_more_posts_access.ajaxurl; // from localized script | |
var page = 2; //number of next page | |
var loadMore = function(){ | |
if($(window).scrollTop() == $(document).height() - $(window).height()){ // if reached the end of the page | |
var data = { | |
'action':'load_more_posts', // ajax action | |
'paged': page,//page number | |
'security': load_more_posts_access.security,//security | |
'request_uri': window.location.pathname |
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
jQuery(function($){ | |
var ajaxurl = load_more_posts_access.ajaxurl; // from localized script | |
var page = 2; //number of next page | |
var loadMore = function(){ | |
if($(window).scrollTop() == $(document).height() - $(window).height()){ // if reached the end of the page | |
var data = { | |
'action':'load_more_posts', // ajax action | |
'paged': page,//page number | |
'security': load_more_posts_access.security,//security | |
}; |
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
//factorial | |
function f(number){ | |
let $ = 1 , _ = 1; | |
while($<=number){ | |
_*=$; | |
$++; | |
} | |
return _; | |
} |
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 permAlone(str) { | |
// Create a regex to match repeated consecutive characters. | |
var regex = /(.)\1+/g; | |
// Split the string into an array of characters. | |
var arr = str.split(''); | |
var permutations = []; | |
var tmp; |
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 permAlone(str) { | |
if(str=='') return 1 | |
const bag=new Map() | |
for(const c of str){ | |
bag.set(c,(bag.get(c)||0)+1) | |
} | |
const essence=[][i]; bits+=v | |
pFact*= fact(i+1)**v * fact(v) | |
bExp-=bMask; bMask<<=v+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
/* | |
Backtaking - BruteForce aproache | |
*/ | |
function permAlone(str) { | |
var perms = []; | |
var arr = str.split(''); | |
function nonRepeated(){ |
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'; | |
//factorial | |
function f(number){ | |
let $ = 1 , _ = 1; | |
while($<=number){ | |
_*=$; | |
$++; | |
} | |
return _; |
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
private Bitmap FastGaussianBlur(BitmapW src, int Raduis) { | |
var bxs = boxesForGaussian(Raduis, 3); | |
BitmapW img = FastBoxBlur(src, bxs[0]); | |
BitmapW img_2 = FastBoxBlur(img, bxs[1]); | |
BitmapW img_3 = FastBoxBlur(img_2, bxs[2]); | |
return img_3; | |
} |
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
private int[] boxesForGaussian(double sigma, int n) { | |
double wIdeal = Math.Sqrt((12 * sigma * sigma / n) + 1); | |
double wl = Math.Floor(wIdeal); | |
if (wl % 2 == 0) wl--; | |
double wu = wl + 2; | |
double mIdeal = (12 * sigma * sigma– n * wl * wl– 4 * n * wl– 3 * n) / (-4 * wl– 4); | |
double m = Math.Round(mIdeal); |
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
private Bitmap FastBoxBlur(Bitmap img, int radius) { | |
int kSize = radius; | |
if (kSize % 2 == 0) kSize++; | |
Bitmap Hblur = img.Clone(); | |
float Avg = (float) 1 / kSize; | |
for (int j = 0; j < img.Height(); j++) { |
NewerOlder