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
https://chat.openai.com/share/3f1472a2-ff59-4b88-bec4-36c75421e3ed | |
""" | |
from sqlalchemy import ( | |
Column, BigInteger, Integer, String, Text, ForeignKey, Uuid, Enum, DateTime, CheckConstraint, | |
) | |
from sqlalchemy import func, select | |
from sqlalchemy.sql.expression import ( | |
case as sql_case, | |
cast as sql_cast, |
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
TWO Rules for writing component function in ReactJS: | |
1. should start with Upper case char | |
2. should return that could be render on the screen | |
ex: | |
""" | |
from MyComp import "./App.jsx"; | |
export default function MyReducerComp(){ | |
const [count, dispatchCount] = useReducer(reducerFunc, 0); |
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
https://console.clever-cloud.com/users/me/addons/addon_1315c43c-935c-4889-b9ab-1c64f93bcf61 | |
Database@123 | |
SQL execution: | |
FROM --> WHERE --> GROUP BY --> HAVING --> SELECT --> ORDER BY | |
1. WITH also known as a Common Table Expression (CTE): | |
> powerful tool for simplifying complex SQL queries and improving query readability. | |
WITH cte_name (column1, column2, ...) AS ( |
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
> Subtract two months from a date, then return the new date | |
SELECT DATEADD(month, -2, '2017/08/25') AS DateAdd; | |
> https://www.w3schools.com/sql/func_sqlserver_dateadd.asp | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
CASE | |
WHEN condition1 THEN result1 | |
WHEN condition2 THEN result2 | |
... | |
ELSE result | |
END |
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
Self-Join: | |
1. https://leetcode.com/problems/rising-temperature/ | |
ANS: | |
SELECT w1.id | |
FROM Weather w1 | |
JOIN Weather w2 | |
ON DATEDIFF(w1.recordDate, w2.recordDate) = 1 | |
WHERE w1.temperature > w2.temperature; |
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
InputStreamReader.............................................................................. | |
- InputStream: class that reads binary data in the form of bytes from a source. | |
- InputStreamReader: It reads bytes using the given InputStream and then converts them into chars | |
based on a certain Charset (UTF-8, UTF-16). | |
- has a read() method that reads a single character (bytes --> characters) | |
remember: | |
InputStreamReader.read() != InputStream.read() | |
1. InputStreamReader reader = new InputStreamReader(new FileInputStream(filePath), StandardCharsets.UTF_8) |
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
# uvicorn main:app --reload | |
# venv\Scripts\activate | |
from fastapi import FastAPI, Body | |
from pydantic import BaseModel | |
app = FastAPI() | |
@app.get("/") |
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
package org.example.ApiC; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; | |
//import org.slf4j.Logger; | |
import java.util.Objects; | |
import okhttp3.MediaType; |
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
spring.application.name=springPractice0 | |
server.port=8083 | |
jwt.secret=mySecretKey123 | |
# import org.springframework.beans.factory.annotation.Value; | |
# @Value("${jwt.secret}") | |
# private String jwtSecret; | |
# [email protected]@ |
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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
import com.fasterxml.jackson.databind.DeserializationContext; | |
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
import com.fasterxml.jackson.databind.annotation.JsonNaming; | |
import com.fasterxml.jackson.databind.json.JsonMapper; |