Skip to content

Instantly share code, notes, and snippets.

@JohnsonLuu
JohnsonLuu / Semantic.html
Created July 23, 2020 07:11
Code Academy's Semantic HTML Review
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>Navigational Links</h1>
<nav>
<ul>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<title>Forms Review</title>
</head>
<body>
<section id="overlay">
@JohnsonLuu
JohnsonLuu / Description.txt
Created July 1, 2020 08:46
Strings Review - Code Academy
Let’s start with username_generator.
Create a function called username_generator take two inputs, first_name and last_name and returns a username.
The username should be a slice of the first three letters of their first name and the first four letters of their last name.
If their first name is less than three letters or their last name is less than four letters it should use their entire names.
For example, if the employee’s name is Abe Simpson the function should generate the username AbeSimp.
Now for the temporary password, they want the function to take the input user name and shift all of the letters by one to the right, so the last letter of the username ends up as the first letter and so forth.
For example, if the username is AbeSimp, then the temporary password generated should be pAbeSim.
def contains(big_string, little_string):
if little_string in big_string:
return True
return False
def common_letters(string_one, string_two):
common_letters = []
for string_un in string_one:
if string_un in string_two and string_un not in common_letters:
common_letters.append(string_un)
@JohnsonLuu
JohnsonLuu / StringSlicing.py
Created June 29, 2020 23:14
More and More String Slicing (How Long is that String?)
first_name = "Reiko"
last_name = "Matsuki"
def password_generator(first_name, last_name):
# -1 gives you the final index of a string
# -3 will thus give you the 3rd index before the end
# print(first_name[len(first_name)-3:] + last_name[len(last_name)-3:])
return first_name[len(first_name)-3:] + last_name[len(last_name)-3:]
temp_password = password_generator(first_name, last_name)
Welcome to The Boredless Tourist, an online application giving you the power to find the parts of the city that fit the pace of your life.
We at The Boredless Tourist run a recommendation engine using Python.
We first evaluate what a person’s interests are and then give them recommendations in their area to venues, restaurants, and historical destinations that we think they’ll be engaged by.
Welcome to The Boredless Tourist, an online application giving you the power to find the parts of the city that fit the pace of your life.
We at The Boredless Tourist run a recommendation engine using Python.
We first evaluate what a person’s interests are and then give them recommendations in their area to venues, restaurants, and historical destinations that we think they’ll be engaged by.
@JohnsonLuu
JohnsonLuu / BugDetective.java
Created June 26, 2020 17:10
Fixed bugs in the given code for a Fortune Cookie Maker - Code Academy
import java.lang.Math;
class Fortune {
public int generateRandom() {
return (int)(Math.random() * 10);
}
@JohnsonLuu
JohnsonLuu / Language.java
Created June 26, 2020 07:06
Language Families - Code Academy
class Language{
protected String name;
protected int numSpeakers;
protected String regionsSpoken;
protected String wordOrder;
Language(String langName, int speakers, String regions, String wdOrder) {
this.name = langName;
this.numSpeakers = speakers;
this.regionsSpoken = regions;
@JohnsonLuu
JohnsonLuu / DNASequencing.java
Created June 24, 2020 03:33
DNA Sequencing - Java - Code Academy
// This program recieves a given string in DNA and checks if any proteins are within.
// Does not consider that multiple proteins could be present.
// -. .-. .-. .-. .
// \ \ / \ \ /
// / \ \ / \ \
// ~ `-~ `-` `-~ `-
public class DNA {
public static void main(String[] args) {
String dna1 = "ATGCGATACGCTTGA";
String dna2 = "ATGCGATACGTGA";