Skip to content

Instantly share code, notes, and snippets.

View HarunMbaabu's full-sized avatar
🎯
Focusing

Harun Mbaabu HarunMbaabu

🎯
Focusing
View GitHub Profile

Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

How to make a clean pull request

Look for a project's contribution instructions. If there are any, follow them.

Fetch API Examples

=====================================================

By: Lux Tech Academy

=====================================================

DEPRECATED BELOW

Table of Contents

It's a very weird error that the set_theme function cannot be found.

Ths error is faced when using seaborn version < seaborn==0.11.0, this error can re-solved by updatingn seaborn module to the latest version of seaborn

On conda run:

conda  install seaborn==0.11.0 

pangram

A pangram is a unique sentence in which every letter of the alphabet is used at least once. The name comes from the Greek root words pan, meaning “all,” and gram, meaning “something written or recorded”.

Problem Description

The program takes a string and checks if it is a pangram or not.

Algorithm

  1. Take a string from the user and store it in a variable.
  2. Pass the string as an argument to a function.
  3. In the function, form two sets- one of all lower case letters and one of the letters in the string.

Writing React Directly in HTML

This method of interacting with React is the simplest way and it’s very easy if you have ever worked with HTML, CSS and JavaScript.

  • You’ll need an HTML file where you load three scripts in the head element pointing to their respective CDN – the React, ReactDOM and Babel.

  • Then, you’ll create an empty div element and give it an id of root. This is where your application will live.

  • Lastly, you’ll create a script element where you write your React code.

This is how your index.html file should look like:

Styling Reactjs App

There are several ways we can style our ReactElements and Compoents but we will only cover the inline CSS, the CSS stylesheet and the CSS Modules.

Some of the other strategies include – CSS-in-JS (e.g styled components, Emotion, JSS), Sass & SCSS, Less, Utility-First-CSS (e.g Tailwind CSS).

CSS Stylesheet

This is quite basic and straight forward method as you should be familiar with it while working with HTML file.

You start by creating a new file called App.css in the src folder.

React File Structure

react-todo-app
    ├── node_modules
    ├── public
    │    ├── favicon.ico
    │    ├── index.html
    │    ├── logo192.png
    │    ├── logo512.png
 │ ├── manifest.json
/* Create an Array */
const marks = new Array(78,90,74,39,80);
/* or */
const marks = [78,90,74,39,80];
/* Join Method */
const array = ["m","o","n","d","a","y"];
console.log(array.join(""));
//output: monday

This is a basic introduction where we learn how to output Hello World! and see the differences between Python and C++.

Main difference in running C++ and Python.

If you are familiar with python, you know we can easily create a file called hello.py and simply run it with python hello.py, However for C++, we’ve 1 more step, the compiling step.

First you Create the file hello.cpp , then you compile it g++ hello.cpp -o hello and finally run it ./hello

“Hello World” program

import pandas as pd
# import library to split the data
from sklearn.model_selection import train_test_split
%matplotlib inline
import matplotlib.pyplot as plt
def read_data():
"""