Skip to content

Instantly share code, notes, and snippets.

View sheland's full-sized avatar

Shelan sheland

View GitHub Profile
/*
A classic stock trading pattern happens when a 9-Day Moving Average (9-DMA) crosses the 50-Day Moving Average (50-DMA).
This can be indicative of a bullish or a bearish setup, depending on the direction. When the 9-DMA crosses below the 50-DMA
from above, it is Bearish. When the 9-DMA cross above the 50-DMA from below, it is Bullish.
Write a program that reads in a series of dates and prices, calculates the 9-DMA and 50-DMA,
then returns the dates of any bullish signals that occurred.
NOTE: The Moving Average cannot be calculated for a given day if there is not enough historical data to cover
the period in question. For example, a series of prices that begin on January 1 cannot have a 9-DMA calculated
before January 9 since 9 days of historical prices do not exist until January 9. Input: A series of Date|Price
pairs in non-localized format. Dates will follow ISO 8601 format YYYY-MM-DD. Prices will be a two-decimal value
@sheland
sheland / product_plan.md
Last active January 4, 2019 18:30
Capstone Product Plan

Capstone Product Plan-Shelan D

1. Personal Learning Goals:

  • Develop a mobile application for Android and iOS devices.
  • Learn how to use HTML5 canvas element to incorporate drawing to an application.
  • Learn to web scrap Tigrinya characters and audio using JavaScript.
  • Gain a deeper understanding of how to incorporate front-end and back-end technology to create a product
  • Manage time effectively to have improved workflow and to complete project goals on time.
  • Become a JS and React Native master
  • Follow personalized time management schedule
@sheland
sheland / capstone_concept.md
Last active December 17, 2018 21:27
Capstone Concept - Shelan D.

Capstone Concept - Shelan D.

Problem Statement #1

Facilitate the learning of the Tigrinya language through the creation of a mobile app for iOS and Android devices. This product aims to help the Eritrean diaspora learn and/or reinforce Tigrinya's skills.

MVP Feature Set

  1. Alphabet flashcards
  • Display extensive alphabet characters
  • Display complete alphabet chart
  • Display sub-sections alphabet chart
@sheland
sheland / flatten_array.rb
Last active September 27, 2018 21:08
Testing Flatten Array
require 'minitest/autorun'
require 'minitest/reporters'
require_relative 'flatten_array'
describe "flatten_array" do
it "returns a single array" do
expect(flatten_array).must_be_kind_of '['Fred', 'Paul', 'Mary']'
end
it "check for nil values" do
# Day 1 of Ada
# Types Practice Worksheet
# Evaluate values and data types
1. Value: 32 Data Type: Fixmun
2. Value: 6 Data Type: Fixmun
3. Value: 44 Data Type: String
4. Value: "dinosaur" "astronaut" Data Type: String
5. Value: 16 Data Type: Fixmun
6. Value: 9 Data Type: String
# Day 1
# Create a program that runs from the Terminal that will create a random menu
# based on several items that you determine
#arrays
adjectives = ["hot", "cold", "warm", "freezing","sizzling", "lukewarm",
"boiling", "blazing", "red", "flaming"]
cooking_style = ["steamed", "boiled", "sautéed", "barbecued", "braised", "charbroiled",
"cured", "dry-roasted", "fried", "glazed"]
foods = ["potatoes", "salad", "lasagna", "pizza", "chicken", "lobsters", "pad-thai", "eggplant",
#Day 6 refactor your original account generator code to utilize arrays with hashes.
#Complete the following refactor steps:
#Utilize a single array variable to store all student information,
#instead of three individual arrays. This array will contain many hashes.
#Utilize a single loop to drive the hash population
#Update the printing functionality to utilize this new hash variable to print out student roster
new_array = []
#Day 2 JSL
#Requirements for candy machine
#Ask the user how much money they have, assume that the $ symbol is part of the prompt
(the user doesn't have to enter it)
#Display all candy options and their costs (even if the user cannot afford the candy)
#Decide whether the user can afford the candy or not, if they can't, tell them so,
#if they can, calculate and display their change
#How would you modify the code below to improve the code style and readability?
foods = ["shrimp", "cauliflower", "salmon", "garlic", "oysters",
"salami", "tomatoes", "okra", "zucchini", "avocado"]
print "How many foods would you like to see? I suggest 10, but it's up to you. "
items = gets.chomp.to_i
if items > 10
puts "Best I can do is 10. Let's do 10."
#Day 6 Exercises
#Updated 7/30/18
#1
#Ask the user to enter the names, ages, and favorite colors of their closest friends
#(you may not assume that the user's close friends all have unique names).
#Output the total number of close friends under 18, followed by their names.
#Output the number of unique favorite colors, and then list them
friends = []