Skip to content

Instantly share code, notes, and snippets.


Fernando Bass ferbass

View GitHub Profile
ferbass /
Last active Aug 7, 2020
Linkedin unfollow all
ferbass /
Created May 5, 2020
1.3 Hidden Messages in the Replication Origin (Part 2)
# Copy your updated FrequentWords function (along with all required subroutines) below this line
def FrequentWords(Text, k):
FrequentPatterns = [] # output variable
# your code here
Count = CountDict(Text, k)
m = max(Count.values())
for i in Count:
if Count[i] == m:
ferbass /
Created May 5, 2020
1.3 Hidden Messages in the Replication Origin (Part 2) 10 out of 13 steps passed
# Input: A string Text and an integer k
# Output: A list containing all most frequent k-mers in Text
def FrequentWords(Text, k):
words = []
freq = FrequencyMap(Text, k)
m = max(freq.values())
for key in freq:
if freq[key] == m:
return words
def FrequencyMap(Text, k):
# your code here
freq = {}
for i in range (n-k+1):
Pattern = Text [i:i+k]
if Pattern not in freq:
freq [Pattern] = 1
freq [Pattern] +=1
ferbass /
Created May 4, 2020
Reverse complement of DNA strand using Python
alt_map = {'ins':'0'}
complement = {'A': 'T', 'C': 'G', 'G': 'C', 'T': 'A'}
def reverse_complement(seq):
for k,v in alt_map.iteritems():
seq = seq.replace(k,v)
bases = list(seq)
bases = reversed([complement.get(base,base) for base in bases])
bases = ''.join(bases)
for k,v in alt_map.iteritems():
def PatternCount(Text, Pattern):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count = count+1
return count
ferbass /
Created Aug 28, 2019
Introduction to Self-Driving Cars - Glossary Terms

ACC: Adaptive Cruise Control

A cruise control system for vehicles which controls longitudinal speed. ACC can maintain a desired reference speed or adjust its speed accordingly to maintain safe driving distances to other vehicles.


A term to express the notion of self, which is used to refer to the vehicle being controlled autonomously, as opposed to other vehicles or objects in the scene. It is most often used in the form ego-vehicle, meaning the self-vehicle.

FMEA: Failure Mode and Effects Analysis

View key

Keybase proof

I hereby claim:

  • I am ferbass on github.
  • I am ferbass ( on keybase.
  • I have a public key ASBIz1bPa8UBMrybqhmZAwxv_qNNUi3ROttgqhpFRc1KkAo

To claim this, I am signing this object:

View key-command.m
NSMutableArray *commands = [[NSMutableArray alloc] init];
NSString *characters = @"`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./";
for (NSInteger i = 0; i < characters.length; i++) {
NSString *input = [characters substringWithRange:NSMakeRange(i, 1)];
/* Caps Lock */
[commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierAlphaShift action:@selector(handleCommand:)]];
/* Shift */
[commands addObject:[UIKeyCommand keyCommandWithInput:input modifierFlags:UIKeyModifierShift action:@selector(handleCommand:)]];
/* Control */
ferbass / button.swift
Created May 3, 2016
Adding a closure as target to a UIButton
View button.swift
import UIKit
extension UIButton {
private func actionHandleBlock(action:(() -> Void)? = nil) {
struct __ {
static var action :(() -> Void)?
if action != nil {
You can’t perform that action at this time.