This file contains hidden or 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
| const [a, setA] = useState(0); | |
| const [b, setB] = useState(0); | |
| // this is onClick Function===== | |
| const testMemo = ()=>{ | |
| setA(val => val + 1) | |
| setB(val => val + 2) | |
| } | |
| // this function for calculation======= | |
| const inner = ()=>{ | |
| console.log("Inner Is calling") |
This file contains hidden or 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 {useEffect, useMemo} from 'react' | |
| import {RecoilRoot, useRecoilState, atom} from 'recoil' | |
| // User data | |
| const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."} | |
| const user2 = {username: 'bob', bio: "I am the one true user."} | |
| const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."} | |
| // A potentially dangerous mutable global variable for initial state. The main |
This file contains hidden or 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
| const version = 1; | |
| const appPrefix = 'myApp-'; | |
| const staticCacheName = appPrefix + 'static-v' + version; | |
| const imagesCacheName = appPrefix + 'content-imgs'; | |
| var allCaches = [ | |
| staticCacheName, | |
| imagesCacheName | |
| ]; | |
| self.addEventListener('message', event => { |
This file contains hidden or 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
| let ar1 = [1,2,3] | |
| let ar2 = [1,2,3,4] | |
| let ar3 = ar1.concat(ar2) | |
| console.log(ar3) | |
| let uniq = [...new Set(ar3)] | |
| console.log(uniq) |
This file contains hidden or 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
| var hobbyOne = "swimming"; | |
| function oldHobby(){ | |
| console.log("Actually old hobby is:",hobbyOne) | |
| } | |
| var hobbiChange = function () { | |
| console.log("My old hobby: " + hobbyOne); | |
| var hobbyOne = "code"; |
This file contains hidden or 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
| function a(){ | |
| for (var i = 0; i<=10; i++){ | |
| var a = setTimeout(()=>{ | |
| var a = 10 | |
| },1000) | |
| var a = setTimeout(()=>{ | |
| var a = 11 | |
| },2000) | |
| var a = setTimeout(()=>{ |
This file contains hidden or 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 tensorflow.keras | |
| from PIL import Image, ImageOps | |
| import numpy as np | |
| # Disable scientific notation for clarity | |
| np.set_printoptions(suppress=True) | |
| # Load the model | |
| model = tensorflow.keras.models.load_model('keras_model.h5') |
This file contains hidden or 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, { Component } from "react"; | |
| class DomAccessing extends Component { | |
| state = { | |
| bgColor: "", | |
| mycolor: '' | |
| }; | |
| onChange = e => { | |
| e.preventDefault(); |
This file contains hidden or 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
| var a = ["monir", "shimul"]; | |
| var b = []; | |
| for (let x of a){ | |
| for (let i=0;i<=x.length-1;i++){ | |
| //console.log(i) | |
| //console.log(x.charAt(i)) | |
| var val = x.charAt(i) |
NewerOlder