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 diff(arr1, arr2) { | |
var newArr = []; | |
for(var i=0;i<arr1.length;i++){ | |
var check=1; | |
for(j=0;j<arr2.length;j++){ | |
if(arr1[i]===arr2[j]) | |
check=0; | |
} | |
if(check===1) | |
newArr.push(arr1[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
/* | |
Problem : LightOJ 1006 - Hex-a-bonacci | |
Link : http://www.lightoj.com/volume_showproblem.php?problem=1006 | |
Author : arsho | |
Date : 05/09/2015 | |
Source : C++ | |
CPU : 0.008 | |
Memory : 1688 | |
*/ | |
#include <bits/stdc++.h> |
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
% Title : Demonstration of SNR improvement by averaging | |
% Date : 7/9/2015 | |
% Author : Shovon | |
clc; | |
image_object=ones(200,300,3); % (height, width) | |
image_size_ar=size(image_object); | |
image_height=image_size_ar(1); | |
image_width=image_size_ar(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
/* | |
SUBMISSION TIME : 2015-10-23 01:53:21 | |
USER : Ahmedur Rahman Shovon | |
PROBLEM : 1006 - Hex-a-bonacci | |
SOURCE : JAVA | |
CPU : 0.320 | |
MEMORY : 24100 | |
VERDICT : Accepted | |
*/ | |
import java.util.Scanner; |
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 Java2DArray; | |
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class Solution { |
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
<?php | |
$_fp = fopen("php://stdin", "r"); | |
while($line=fgets($_fp)){ | |
$line = strtolower($line); | |
$line_length = strlen($line); | |
$char_ar=array(); | |
for ($i=0;$i<$line_length;$i++){ | |
$current_char = $line[$i]; | |
if(preg_match('/^[a-z]$/',$current_char)){ | |
$char_ar[$current_char] = 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
def digit_checking(a,b): | |
x = a%10 | |
y = b%10 | |
check_match = 0 | |
if x == y: | |
check_match=1 | |
a = a//10 | |
b = b//10 | |
if (a == 0) or (b == 0): | |
return check_match |
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 sumAll(arr) { | |
var min = Math.min(arr[0] , arr[1]); | |
var max = Math.max(arr[0] , arr[1]); | |
var sum = 0; | |
for(var i=min ; i<=max ; i++) { | |
sum+=i; | |
} | |
return sum; | |
} |
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
<?php | |
$server_name = 'localhost'; | |
$db_username = 'DB_USERNAME'; | |
$db_password = 'DB_PASSWORD'; | |
$db_name = 'DB_NAME'; | |
try{ | |
$conn = new PDO("mysql:host=$server_name;dbname=$db_name",$db_username,$db_password); | |
$conn -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
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 calculate_tax(income_dict): | |
tax_dict = dict() | |
for person_name in income_dict.keys(): | |
person_income = income_dict[person_name] | |
person_tax = 0 | |
income_limit = [1000,10000,20200,30750,50000] | |
income_range = [1000,9000,10200,10550,19250] | |
tax_range = [0,.1,.15,.2,.25] | |
for i in range(len(income_range)): | |
if person_income <= 0: |
OlderNewer