I hereby claim:
- I am chinying on github.
- I am chinying (https://keybase.io/chinying) on keybase.
- I have a public key ASDMWiUE1DQYp_BvwzkTRS7rOusW3bcrcEa1FlxI0sYWlgo
To claim this, I am signing this object:
public static boolean checkAnagram(String s1, String s2){ | |
if (s1.length() != s2.length()) return false; | |
int wt1 = 0, wt2 = 0, i; | |
for (i=0; i<s1.length(); i++) wt1+=(int)(s1.charAt(i)); | |
for (i=0; i<s2.length(); i++) wt2+=(int)(s2.charAt(i)); | |
return wt1 == wt2; | |
} |
private Vector<String> mergeSort(Vector<String> v){ | |
int sz = v.size(); | |
if (sz > 1){ | |
int m = sz >>> 1; | |
Vector<String> leftList = new Vector<String>(); | |
Vector<String> rightList = new Vector<String>(); | |
int n; | |
for (n=0; n<m; n++) leftList.add(v.elementAt(n)); | |
for (n=m; n<sz; n++) rightList.add(v.elementAt(n)); |
#include <cstdio> | |
#include <cmath> | |
typedef long long ll; | |
//Returns length of integer | |
int len(int n){ | |
return (n == 0 ? 1 : (int)(log10(n)+1)); | |
} |
class f{ | |
public static int max(int x, int y){ | |
return (x > y) ? x : y; | |
} | |
public static int min(int x, int y){ | |
return (x < y) ? x : y; | |
} | |
public static void main(String [] args){ |
import java.io.*; | |
import java.util.*; | |
public class Huffman{ | |
private int N; | |
private PriorityQueue<Node> pq; | |
private Node root; | |
public Huffman(String[] s, int[] freq){ | |
N = s.length; |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.InputStreamReader; | |
import java.util.StringTokenizer; | |
import java.util.LinkedList; | |
import java.util.Stack; | |
/* | |
* WIP : order based methods | |
* min, max, floor, ceiling, selection |
import string, random | |
letters = (list(string.ascii_letters)) | |
numbers = [n for n in string.digits] | |
alphanumeric = (letters + numbers) | |
genlen = 12 | |
result = random.sample(alphanumeric, genlen) | |
print("".join(result)) |
from collections import defaultdict | |
filepath = "" | |
classname = "" | |
fo = open(filepath) | |
contents = fo.read().split("\n") | |
def find_constructors(contents): | |
contd = False # continue looking | |
tmp_constructor = "" | |
constructors, idxs = [], [] |
I hereby claim:
To claim this, I am signing this object:
-- not my code, found on http://apple.stackexchange.com/a/217029 | |
on run {input, parameters} | |
set theOutput to {} | |
tell application "Microsoft PowerPoint" -- work on version 15.15 or newer | |
launch | |
set theDial to start up dialog | |
set start up dialog to false | |
repeat with i in input | |
open i | |
set pdfPath to my makeNewPath(i) |