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 fs = require( 'fs' ); | |
var path = require( 'path' ); | |
// In newer Node.js versions where process is already global this isn't necessary. | |
var process = require( "process" ); | |
var folder = path.join(__dirname,"/folder_name"); | |
console.log(folder); | |
// Loop through all the files in the temp directory | |
fs.readdir( folder, function( err, files ) { |
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
//Select Stat counter element | |
var y = document.querySelectorAll('.credit_value [data-counter-value="2000000"]'); | |
//Get user income from wp member field if id user_income | |
var user = document.querySelectorAll('#user_income .wpb_wrapper')[0]; | |
var user_income = user.innerHTML; | |
var income = user_income.split(" ")[0]; | |
income = income.replace(',', ''); | |
income = Number(income) - 1; | |
console.log(income); | |
///set the data-counter-value attribute of the stat counter to the user monthly income |
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
def binary_converter(n): | |
if type(n) == str or n > 255 or n < 0: | |
print 'Invalid input' | |
return 'Invalid input' | |
if n == 0: | |
return '0' | |
numb = int(n) | |
result = [] | |
while numb != 0: | |
result.append(numb%2) |
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
def chkSqe(a1, a2): | |
''' | |
this method receive two array on characters, a1, and a2 | |
it checks array a1 is the sequence of character in a2 exist | |
in the order, and returns true is so, or false if not | |
Args: a1: array of characters | |
a2: array of characters | |
Return: Boolean | |
''' | |
char_to_chk = 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
function solution(A) { | |
var length = A.length; | |
if (length == 1){ | |
return 0; | |
} | |
if (length < 1){ | |
return -1; | |
} | |
if (A.slice(1).reduce((a,b) => a+b) === 0){ | |
return 0 |