This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { SketchPicker } from "react-color"; | |
class App extends React.Component { | |
state = { | |
background: "#fff", | |
}; | |
handleChangeComplete = (color) => { | |
this.setState({ background: color.hex }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { View, Text, StyleSheet, TouchableOpacity, Animated } from 'react-native'; | |
const App = () => { | |
const [slideAnim] = useState(new Animated.Value(0)); | |
const [isSlideIn, setIsSlideIn] = useState(false); | |
const slideIn = () => { | |
Animated.timing(slideAnim, { | |
toValue: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import requests | |
from urllib.request import urlopen | |
from io import BytesIO | |
from IPython.display import Image, display | |
# Function to detect dominant colors in an image | |
def detect_colors(image_url, num_colors=5): | |
# Download the image from the URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install folium opencage phonenumbers | |
# track location with the map using the phone number | |
import phonenumbers | |
from phonenumbers import geocoder | |
from phonenumbers import carrier | |
import folium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
import {useState,useEffect} from 'react' | |
import axios from 'axios' | |
function App() { | |
//creating IP state | |
const [ip, setIP] = useState(''); | |
//creating function to load ip address from the API | |
const getData = async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncoment this if you already install | |
# !pip install langdetect | |
from langdetect import detect | |
text = input("Enter any text in any language: ") | |
print(detect(text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment and run this code if you not installing yet | |
# !pip install opencv-python | |
import cv2 | |
import numpy as np | |
import pandas as pd | |
img_path = "/Users/admin/Project/ml_project/colordetection/ikan-hiu.png" | |
img = cv2.imread(img_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { render, screen, waitFor } from "@testing-library/react"; | |
import userEvent from "@testing-library/user-event"; | |
import App from "./App"; | |
describe("Render app", () => { | |
test("should change input value when user type", async () => { | |
render(<App />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from 'react' | |
export default function App() { | |
const [text, setText] = useState("") | |
return ( | |
<div style={{marginLeft:"20px"}}> | |
<h1>Input</h1> | |
<input value={text} onChange={(e) => setText(e.target.value)} placeholder="input data" data-testid='input-form'/> | |
</div> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { render, screen, waitFor } from "@testing-library/react"; | |
import userEvent from "@testing-library/user-event"; | |
import App from "./App"; | |
describe("Render app", () => { | |
test("should change input value when user type", async () => { | |
render(<App />); |
NewerOlder