interface WithLoadingProps {
loading: boolean;
}
const withMaybe = <P extends object>(predicate: (props: P) => boolean) =>
(Component: React.ComponentType<P>) =>
(props: P) => predicate(props) ? <Component {...props}/> : null;
const url = 'https://www.lego.com/ko-kr/product/horizon-forbidden-west-tallneck-76989'; | |
const stockSelector = "#main-content > div > div.ProductDetailsPagestyles__ProductOverviewContainer-sc-1waehzg-1.dgDnXa > div > div.ProductOverviewstyles__Container-sc-1a1az6h-2.hHubKC > div.ProductOverviewstyles__PriceAvailabilityWrapper-sc-1a1az6h-10.bwcpjP > p > span"; | |
const titleSelector = "#main-content > div > div.ProductDetailsPagestyles__ProductOverviewContainer-sc-1waehzg-1.dgDnXa > div > div.ProductOverviewstyles__Container-sc-1a1az6h-2.hHubKC > div.ProductOverviewstyles__ProductOverviewRow-sc-1a1az6h-1.hblOYO > h1 > span"; | |
async function loadWeb(url, selectors) { | |
const wv = new WebView(); | |
wv.loadURL(url); | |
await wv.waitForLoad(); | |
return await wv.evaluateJavaScript(` |
Key.on("left", ["ctrl", "alt", "cmd"], function () { | |
const window = Window.focused(); | |
if (window) { | |
const currentFocusedScreen = window.screen(); | |
const screen = currentFocusedScreen.flippedVisibleFrame(); | |
// const screen = currentFocusedScreen.next().flippedVisibleFrame(); | |
if (isCloseRect(window.frame(), {x: screen.x, y: screen.y, width: screen.width / 2, height: screen.height})) { | |
if (closeTo(window.frame().width, screen.width / 2)) { | |
window.setFrame({ |
const url = encodeURI("https://m.search.daum.net/kakao?w=tot&DA=Z8T&rtmaxcoll=Z8T&q=์์ธ ์ค๋ ๋ ์จ") | |
const wv = new WebView() | |
wv.loadURL(url) | |
await wv.waitForLoad() | |
const cont = await wv.evaluateJavaScript(`[...document.querySelectorAll(".cont_air>ul>li")].map(t => { | |
return { | |
title: t.querySelector('.txt_type')?.innerText, |
import React, {FC} from "react"; | |
const SimpleLineChart: FC<{ | |
width: number; | |
height: number; | |
strokeWidth?: number; | |
strokeColor?: string; | |
data: { value: number; label?: string }[]; | |
padding?: number; | |
}> = ({ |
const DonutChart: FC<{ | |
size: number; | |
data: { | |
value: number; | |
color: string; | |
}[]; | |
strokeWidth?: number; | |
bgColor?: string; | |
}> = ({size, strokeWidth = 10, bgColor, data}) => { | |
const cx = size / 2; |
// ์์ ๋ด์ฉ: ํ์ด์ง ๋์ ajax ํธ์ถ๋ก ์๋ ํฅ์, ๋ฐ์ดํฐ ์ฌ์ฉ๋ ๊ฐ์ | |
// ๊ธฐ๋ณธ ์์ ๊ฒ์ ๋ฐฐ๊ฒฝ, ํฐ ๊ธ์จ, ๋นจ๊ฐ ์์ด์ฝ์ผ๋ก ๋ณ๊ฒฝ | |
const source = 'http://corona-live.com'; | |
const request = new Request('https://apiv2.corona-live.com/stats.json?timestamp='+Date.now()) | |
const response = await request.loadJSON() | |
const count = response.overview.current[0]; | |
const now = new Date(); | |
const date = `${now.getMonth()+1}์ ${now.getDate()}์ผ ${now.toLocaleString('kr', { hour: 'numeric', minute: 'numeric', hour12: true })}`; |
// code from typescript/lib/lib.dom.d.ts | |
// It is useful when using react-native with typescript. | |
// Or you can add dom libarary as `lib: ["esnext" ,"dom"]` in tsconfig.json | |
interface WebSocketEventMap { | |
"close": CloseEvent; | |
"error": Event; | |
"message": MessageEvent; | |
"open": Event; | |
} |
JPA
์ JPA? ๊ฐ์ฒด์งํฅ ๋ชจ๋ธ๋ง์ ํ ์ ์์. ์ฐ๊ด๊ด๊ณ์ ๊ด๋ จ๋ ํจ๋ฌ๋ค์ ๋ถ์ผ์น๋ฅผ ํด๊ฒฐํด์ค. ๊ฐ์ฒด ๊ทธ๋ํ ํ์์ด ๊ฐ๋ฅํจ.(sql ์ ์ง์ ์ฌ์ฉํ ๊ฒฝ์ฐ sql ์ ๋ฐ๋ผ ๊ฐ์ฒด ๊ทธ๋ํ๋ฅผ ์ด๋๊น์ง ํ์ํ ์ ์๋์ง ์ ํด์ง). ๋น๊ต์ ์์ด์ sql ์ ํตํด ๊ฐ์ ๋ก์ฐ๋ฅผ ๊ฐ์ ธ์ฌ ๊ฒฝ์ฐ ์ธ์คํด์ค๊ฐ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ๋์ผ์ฑ ๋น๊ต์ ์คํจ(์ด๊ฑด equals ๋งค์๋ ๊ตฌํ์ด ๊ผญ ํ์ํจ)
์์ฐ์ฑ, ์ ์ง๋ณด์, ์ฑ๋ฅ, ๋ฐ์ดํฐ ์ ๊ทผ ์ถ์ํ, ๋ฒค๋ ๋ ๋ฆฝ์ฑ, ํ์ค
์์น ๋ฏธ๋ถ Numerical Differentitaion link
f(x) = ax^n f`(x) = anx^(n-1) = df/dx (x) // ๊ตฌ์กฐ์ ์ผ๋ก ๋ฏธ๋ถํ๋ ํด์์ ๋ฐฉ๋ฒ
ํ์ง๋ง ์ปดํฐ์ ๋ฌดํ์๊ฐ ์๊ธฐ๋๋ฌธ์ ์์น ๋ฏธ๋ถ์ ํจ
df/dx (x) = ( f(x + dx) - f(x) ) / dx // forward differentiation