Skip to content

sbravo15/core-code-from-scratch-readme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 

Repository files navigation

Week 1

Week 1 challenges (Tuesday)

1. Explanation About Interpreted And Compiled Programming Languages

Computers don't speak English or Spanish, they speak Machine Code. Machine code is a computer programming language comprising binary instructions which computers respond to directly, It's written in machine language. Therefore, a machine i.e., a computer, can execute it without any translation or conversion.

So then, How do computers read the code we write in a programming language? If we gave computers the text of the logic and instructions we want to execute with a set program, the computer wouldn't have a way to read it and execute it.

Introducing Interpreted and Compiled Programming Languages

A programming language allows us to translate the abstract 1 & 0's / Binary into something humans can understand.

Two types of languages

  1. High-Level Ex: Java, Javascript, Python, C# and many more.

Upside: Easier for us to understand the syntax and write code.

Downside: It takes longer to translate into machine code.

  1. Low-Level Languages that are closer to Machine Code therefore easier for the computer to read.

Benefits Include: They're fast, precise control on how they want the computer to function.

Ex: Machine code, Assembly Language

We need to get our Source Code converted into Machine code somehow before it can run: There are two ways to turn Source code into machine code and it's up to the language you're using Compiled or Interpreted language.

  1. Compiled: Source Code Compiler Program : Translates Source Code into Machine Code and makes it an Executable file (Machine Code) Separate Executable file on Machine Code Executable File

  2. Interpreted Source Code Interpreter Program (turns it into machine code on the fly, line by line, on the spot) Processes on the spot (Not saved as a another file) Ex: Javascript interpreted into the web browser

Compiled

Pros Cons
ready to to run not cross platform
often faster inflexible
source code is private extra Step

Interpreted

Pros Cons
cross-Platform interpreter required
simpler to test inflexible
easier to debug source code is public

Compiled: C, C++, Objective-C Interpreted: PHP, JavaScript Hybrid: Java, C#, VB.Net, Python

Intermidiate Approach: Takes it as far as it can into Machine Code, often Assembly and let's the other party finish the rest.
JIT: Just in time compilation.

2. Is Java compiled or interpreted, or both?

Java is an Intermidiate Hybrid approach where it's neither compiled or interpreted all at one time, it's done half and half, we compile one part of the way to what's called an intermidiate language which takes it as far as long to machine code as it can get while still being portable across platforms, you then distribute the Intermidiate Language File sending it to the people who need to run it and each person who runs it takes it to the last step to take it to machine code. JIT Compilation / Bite Code.

3. Pseudocode currency converter

  1. START
  2. BTC <--- GET FROM ('https://www.coinbase.com/price/bitcoin')
  3. USD <--- GET
  4. BTC2USD <--- BTC * USD
  5. Print BTC2USD
  6. END

Interpreted vs Compiled Programming Languages: What's the Difference? ^1 What is Machine code Video ^2.
Compiler and Interpreter: Compiled Language vs Interpreted Programming Languages ^3. What is a programming language? ^4.

  1. https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/
  2. https://www.youtube.com/watch?v=-XU3GbHBOKA&ab_channel=MarketingBusinessNetwork
  3. https://www.youtube.com/watch?v=I1f45REi3k4&ab_channel=CodingMentors
  4. https://www.youtube.com/watch?v=EGQh5SZctaE&ab_channel=Codecademy

Week 1 challenges (Wednesday)

DOB: 2002

  • 2^0 = 1
  • 2^1 = 2
  • 2^2 = 4
  • 2^3 = 8
  • 2^4 = 16
  • 2^5 = 32
  • 2^6 = 64
  • 2^7 = 128
  • 2^8 = 256
  • 2^9 = 512
  • 2^10 = 1024
  • 2^11 = 2048
2^10 2^9 2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
1 1 1 1 1 0 1 0 0 1 0

Anwser= 11111010010

Misp Exercises:

Week 1 challenges (Thursday)

Feedback on the Videos and Re-search

Summary

The Weird History of Java

It was really interesting video to watch, gave me a perspective on how javascript has evolved over the las two decades and a half since it's release in Dec '95 Brendon Ike's, being banned by MS in the Internet Explorer, Ecma Standarizing JS, touch on the Tech Bubble of march 2000s, Jquery, sep 8 Chrome V8engine, May 2009 Node Js "Launch Web applications at scale", ES 3.1 == ES5, ES5 introduced (JSON SUPPORT, Functional array and object methods, stric mode, accessors many other), Single Page application frameworks Oct 2010: Backbone & Angular, similar problem different approaches. backbone was light weight Dom updates with imperative programming style, Angular Js more inclusive and use declarative programming, 2015 React Js included angular js with declarative UI but improve them with uni-directional data flow immutability and use of the virtual DOM. The creator of the video is Bullish on javascript, and has learned to always bet on javascript.

Week 2

Week 2 Subtopics

  • Loops
    • While
    • For
  • Conditionals
  • Ternary Operator
  • Functions
    • Difference between arguments and parameters
    • Default parameters
    • Arguments array
  • scopes
  • var, let, const
  • Operators
    • TypesOf
  • Data Structure
    • Array
    • List
    • Stack

Week 2 challenges (Monday)

  1. Create a Code Wars Account https://www.codewars.com/users/sbravo15 DONE

Week 2 challenges (Tuesday)

Code Wars Challenges

1. Multiply exercise DONE

function multiply(a, b){
  return a * b
}

3. ASCII Total exercise DONE

function uniTotal (string) {
  let total = 0; //Variable Total
  for (let i = 0, length = string.length; i<length; i++){
    total += string[i].charCodeAt(); //Suma Charcode al total (Loopea el string y va sumando)
  }
  return total; //Retorna la variable total (Sum of the Chars)
}

4. Char From ASCII Value exercise DONE

function getChar(c){
  let char = String.fromCharCode(c);
  return char
}

5. Binary Addition exercise DONE

function addBinary(a,b) {
  let sum = a+b;
  let res = sum.toString(2); //to string(2) turns it into a binary number
  return res
}

6. Student's Final Grade exercise DONE

function finalGrade (exam, projects) {
  // final grade
  if (exam > 90 || projects > 10){
    let grade = 100
    return grade
  } else if (exam > 75 && projects>=5){
    let grade = 90
    return grade
  } else if (exam>50 && projects>=2){
    let grade = 75
    return grade
  } else{
    return 0
  }
}

Week 2 challenges (Wednesday)

Code Wars Challenges

1. Holiday VIII - Duty Free exercise DONE

function dutyFree(normPrice, discount, hol) {
  /* 
    what would be the price of a bottle with the discount?
    normalPrice  --- 100%
    dicountPrice --- discount%
  */
  let dicountPrice = (normPrice * discount) / 100;
  // How many bottles at the discount price will cover the hol cost? 
  let bottlesWithDicountPriceToCoverHoliday = hol / dicountPrice;
  // Please return an integer. Round down. 
  let roundedResult = Math.floor(bottlesWithDicountPriceToCoverHoliday);
  return roundedResult;
}

2. Twice As Old exercise DONE WH

function twiceAsOld(dadYearsOld, sonYearsOld) {
  return Math.abs(((sonYearsOld*2)-(dadYearsOld)))
}

3. Valid Spacing exercise DONE WH

function validSpacing(s) {
  
// Verifica espacios vacios al Principio y al final del string  

if (s.charAt(0) === ' ' || s.charAt(s.length - 1) === ' ') { 
     return false;
  }
 
 //Loopea el string : Si el char es espacio vacio y le suma un espacio y el otro es vacio == False 
 
  for (let i = 0; i < s.length; i++) {
    if(s.charAt(i) === ' '){ // es el caracter que estamos viendo igual a un espacio?
      if(i != 0 && s.charAt(i-1) === ' ') {
        return false;
      }
      if (i != (s.length - 1) && s.charAt(i+1) === ' ') {
        return false;
      }
    }
    // ....
  }
  
  return true; // fuera la verificacion
}
 

4. Fake Binary exercise DONE WH

function fakeBin(x){
  let resultDigits = "";
  for (let i=0; i< x.length; i++){
    if(parseInt(x[i]) < 5){
       resultDigits = resultDigits +"0";
       }else {
         resultDigits = resultDigits + "1"; 
       }
  }
  return resultDigits; 
}  

Week 2 challenges (Thursday)

Code Wars Challenges

1. Remove All Exclamation Marks From The End Of Sentence exercise DONE

function remove (string) {  
  //Implementation (regex)
 return string.replace(/!+$/, "");
 

2. Vowel Remover exercise DONE

function shortcut(string){
  return string.replace(/[aeiou]/g,'')
}

3. Rock Paper Scissors! exercise DONE

const rps = (p1, p2) => { 
  //rock & rock // p & p // s & s 
  // rock < paper // paper < scissor //scissor < rock // 
  
if (p1 === "rock" && p2 === "scissors"){
  return "Player 1 won!";
}else if(p2 ==="rock" && p1 === "scissors"){
  return "Player 2 won!";
}else if(p1 === "paper" && p2 === "scissors"){
    return "Player 2 won!";
}else if(p2 === "paper" && p1 === "scissors"){
    return "Player 1 won!";
}else if( p1 === "rock" && p2 === "paper"){
    return "Player 2 won!";
}else if( p1 === "paper" && p2 === "rock"){
    return "Player 1 won!";
}else{
  return "Draw!"; 
}
};

4. Persistent Bugger exercise n/a

Week 3

Week 3 Subtopics

  • Object
  • DOM API
  • ES6 features
    • Template strings
    • Arrow functions
    • Rest/Spread operator
    • Destructuring assigment
  • Array Map

Week 3 challenges (Monday)

Code Wars Challenges

1. Who Likes It? n/a

2. Bit Counting n/a

3. Your Order, Please n/a

Week 3 challenges (Tuesday)

Code Wars Challenges

1. Simple Pig Latin. n/a

2. Counting Duplicates n/a

3. Decode The Morse Code n/a

Week 3 challenges (Wednesday)

Code Wars Challenges

1. Valid Parentheses n/a

2. Convert String To Camel Case n/a

3. Unique In Order n/a

Week 3 challenges (Thursday)

Code Wars Challenges

1. Fold An Array n/a

2. Encrypt This! n/a

  1. ✨Complete your 1st Core Challenge. This is one of the requirements for the certification, where you'll boost your dev professional-brand. n/a

Week 4

Week 4 Subtopics

  • Regular expressions
  • Array Reduce
  • Array Filter
  • Q&A

Week 4 challenges (Monday)

  1. Learn about for loop

  2. Follow this JavaScript Array Filter video

  3. Follow this JavaScript Array Reducer video

  4. Follow this JavaScript Array Map video

Week 4 challenges (Tuesday)

  1. Watch this Regular Expressions (RegEx) video
  2. Read Regular Expressions - MDN documentation
  3. Learn about replace in this video
  4. Read replace - MDN documentation
  5. Check Regexr, a tool to test your regular expressions
  6. A complete Regular Expressions video

Week 4 challenges (Wednesday)

1. Simple Calidation of a Username exercise n/a

2. Get Number from String exercise n/a

Week challenges (Thursday) 💻

1.String Cleaning exercise n/a

2.Password Validation exercise n/a

  1. ✨Complete your 2nd Core Challenge. This is one of the requirements for the certification, where you'll boost your dev professional-brand.

1.Regular Expressions In Javascript Reading

2.Methods That Use Regular Expressions In Javascript

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published