This file contains 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
# There are basically two functions in this gist. The first function | |
# get_covariance_matrix is basically a helper function. | |
# The other one get_mutual_information_based_best_sample is the one that is used as sampling | |
# strategy. | |
def get_covariance_matrix(matrix_a, matrix_b): | |
"""Takes two matrices (2 dimensional arrays) and returns covariance matrix.""" | |
cov_matrix = [] | |
for i,elements_a in enumerate(matrix_a): |
This file contains 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 GSoCStudentRegistrationDataSeeding(): | |
program_helper = program_utils.GSoCProgramHelper() | |
sponsor = program_helper.createSponsor() | |
gsoc = program_helper.createProgram(override={'name':'Google Summer of Code', | |
'short_name':'gsoc new'}) | |
org_app = program_helper.createOrgApp() | |
timeline = timeline_utils.GSoCTimelineHelper(gsoc.timeline, org_app) | |
timeline.studentSignup() | |
site = program_helper.createSite() |
This file contains 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
n=input() | |
for i in range(0,n): | |
string = raw_input() | |
print ("YES","NO")[(sorted(string[:len(string)/2])!=sorted(string[len(string)/2+(len(string)%2):]))] |
This file contains 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
#! /bin/bash/python | |
# Author : Piyush Bansal | |
# To check if a key is valid ssh key (rsa) | |
# REQUIREMENTS : give input a file , that has one ssh-key in it. | |
# RESULT : valid/not valid ssh-key | |
# NOTE : initial devel. phase, needs to to tweaked to make it suitable for our use here. | |
import base64,struct,sys,binascii |