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 extract_links(self, url): | |
urls = [] | |
htmlPattern = re.compile(r'(http://[A-Za-z0-9\'~+\-=_.,/%\?!;:@#\*&\(\)]+)') | |
if htmlPattern.match(url) is None: | |
return "error" | |
try: | |
html = urllib2.urlopen(url) | |
except urllib2.URLError, e: |
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
public synchronized Mat gammaFilter(Mat inputPicture) { | |
Mat result = new Mat(); | |
inputPicture.copyTo(result); | |
Mat lut = new Mat(1, 256, CvType.CV_8UC1); | |
lut.setTo(new Scalar(0)); | |
double gamma = 3; | |
for (int i = 0; i < 256; 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
for i in [1..100] | |
str = if i % 3 is 0 and i % 5 is 0 | |
"fizzbuzz" | |
else if i % 3 == 0 | |
"fizz" | |
else if i % 5 == 0 | |
"buzz" | |
else | |
i | |
console.log(str) |
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
shuffle = (array) -> | |
for i in [array.length-1..0] | |
j = Math.floor( Math.random() * (i + 1) ) | |
[array[i], array[j]] = [array[j], array[i]] | |
return array |
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
max_num = 100 | |
random = Math.round(Math.random() * max_num) |
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
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.util.Scanner; | |
public class Otsuri { | |
static Scanner scanner; | |
int COIN_NUM = 4; | |
int[] coinValue = new int[]{10, 50, 100, 500}; |
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
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.util.Scanner; | |
public class NumeralSystem { | |
static Scanner scanner; | |
NumeralSystem() { |
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
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.util.Scanner; | |
public class UnitFractionPartition { | |
static Scanner scanner; | |
int p,q,a,n; | |
int count = 0; | |
UnitFractionPartition(){ |
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
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.util.Scanner; | |
public class RedAndBlack { | |
static Scanner scanner; | |
static char[][] dyx; | |
static int[][] move = {{1,0},{0,-1},{-1,0},{0,1}}; | |
static boolean[][] result; |
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
public class BinaryCode { | |
public String[] decode(String message) { | |
String[] ans = new String[2]; | |
for (int i = 0; i < ans.length; i++) { | |
ans[i] = calc(i, message.toCharArray()); | |
System.out.println(ans[i]); | |
} | |
return ans; |
OlderNewer