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 json | |
| from rna_motif_library import motif | |
| # mtypes in cached motifs: | |
| # {'UNKNOWN', 'HELIX', 'SSTRAND', 'NWAY', 'TWOWAY', 'HAIRPIN'} | |
| # mtypes in my data: | |
| # {'JUNCTION', 'SINGLESTRAND', 'HAIRPIN', 'HELIX'} |
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
| from scipy.stats import mannwhitneyu | |
| def score(sequence, secondary_structure, reactivities): | |
| """ | |
| Inputs: | |
| sequence: RNA sequence containing A, C, G, or U. Does not handle wildcards | |
| like N, X, etc. | |
| secondary_structure: Must be dot-bracket notation containing ., (, and ). Does |
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
| class Person: | |
| def __init__(first_name, last_name, age): | |
| self.first_name = first_name | |
| self.last_name = last_name | |
| self.age = age | |
| def set_age(new_age): | |
| self.age = new_age | |
| def get_age(): |
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
| from array import ArrayType, array | |
| class Ring(ArrayType): | |
| def __init__(self, *args, **kwargs): | |
| self._set_iter_defaults() | |
| super().__init__() | |
| def __getitem__(self, i): | |
| return array.__getitem__(self, i % len(self)) |
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
| #include <stdio.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| int main() { | |
| printf("Printing before first fork\n"); | |
| int t = fork(); | |
| if (t != 0) { | |
| printf("Printing from first forked process, PID %d\n", t); |
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
| require 'benchmark' | |
| require 'ostruct' | |
| class ExecutionMeasurement | |
| attr_accessor :measures | |
| def initialize(experiments=1000, &block) | |
| @note = 'PLEASE NOTE: All times are in miliseconds' | |
| @func = block || nil | |
| @measures = [] |
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
| $group_policy_profiles = (netsh wlan show profile) | |
| $user_profiles = @() | |
| foreach ($policy_profile in $group_policy_profiles) { | |
| if ($policy_profile -match "All User Profile") { | |
| $profile_name = $policy_profile.split(":")[1] | |
| $user_profiles += $profile_name.Remove(0, 1) | |
| } | |
| } | |
| $network_data = @() |
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 math | |
| def fib(n): | |
| ar = [0, 1] | |
| if n < len(ar): | |
| return ar[n] | |
| else: | |
| while n > len(ar)-1: | |
| ar.append( | |
| ar[len(ar)-1] + ar[len(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
| import cv2 | |
| # Make a generator object for the message to be hidden | |
| def char_generator(message): | |
| for c in message: | |
| yield ord(c) | |
| # Convenience function for getting image | |
| def get_image(image_location): | |
| img = cv2.imread(image_location) |