11 2020 档案

摘要:pom.xml: <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependenc 阅读全文
posted @ 2020-11-30 22:36 Zhentiw 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Define an action to update the record: import { createAction, props } from "@ngrx/store"; import { Update } from "@ngrx/entity"; import { Course } fro 阅读全文
posted @ 2020-11-30 19:13 Zhentiw 阅读(112) 评论(0) 推荐(0) 编辑
摘要:Reducer: import { Course, compareCourses } from "../model/course"; import { EntityState, createEntityAdapter } from "@ngrx/entity"; import { createRed 阅读全文
posted @ 2020-11-30 04:05 Zhentiw 阅读(276) 评论(0) 推荐(0) 编辑
摘要:Run bash to generate keystore.jks in src/mian/resources folder: keytool -genKey -keyalg RSA -alias linkedin -keystore keystore.jks -storepass password 阅读全文
posted @ 2020-11-30 03:50 Zhentiw 阅读(69) 评论(0) 推荐(0) 编辑
摘要:Profiles allow us to do different configurations based on different env. application.yml: spring: profiles: dev server: port: 8000 spring: profiles: t 阅读全文
posted @ 2020-11-30 03:29 Zhentiw 阅读(101) 评论(0) 推荐(0) 编辑
摘要:We can use @Controller to return a view with data: package com.frankmoley.lil.learningspring.web; import com.frankmoley.lil.learningspring.busniess.do 阅读全文
posted @ 2020-11-29 03:42 Zhentiw 阅读(93) 评论(0) 推荐(0) 编辑
摘要:Controller: @Controller @RequestMapping("/reservations") public class RoomReservationWebController { @Autowired private ReservationService reservation 阅读全文
posted @ 2020-11-29 02:41 Zhentiw 阅读(127) 评论(0) 推荐(0) 编辑
摘要:first(predFn, defVal) first can do the work for both "filter" + "take(1)" which filtering the data and end observable. // RxJS v6+ import { from } fro 阅读全文
posted @ 2020-11-26 17:09 Zhentiw 阅读(90) 评论(0) 推荐(0) 编辑
摘要:Opening large JSON files inside of your IDE or text editor can be a pain at times, with this command line tool you can drill down into large JSON file 阅读全文
posted @ 2020-11-26 03:23 Zhentiw 阅读(62) 评论(0) 推荐(0) 编辑
摘要:export let mapError = transform => broadcaster => listener => { return broadcaster((value) => { if (value instanceof Error) { listener(transform(value 阅读全文
posted @ 2020-11-26 03:15 Zhentiw 阅读(69) 评论(0) 推荐(0) 编辑
摘要:let getUrl = url => listener => { let controller = new AbortController() let signal = controller.signal fetch(url, {signal}) .then((response) => { ret 阅读全文
posted @ 2020-11-26 03:09 Zhentiw 阅读(148) 评论(0) 推荐(0) 编辑
摘要:While using async/await, seeing such error: Uncaught ReferenceError: regeneratorRuntime is not defined Solution: in package.json, add: "browserslist": 阅读全文
posted @ 2020-11-26 03:00 Zhentiw 阅读(145) 评论(0) 推荐(0) 编辑
摘要:You often want to ignore values until the user performs a certain action. This lesson walks through setting up an allowWhen broadcaster that will only 阅读全文
posted @ 2020-11-24 21:58 Zhentiw 阅读(129) 评论(0) 推荐(0) 编辑
摘要:https://github.com/mike-north/professional-ts/blob/master/notes/04-mikes-ts-setup.md#api-surface-report--docs Install: yarn add -D @microsoft/api-extr 阅读全文
posted @ 2020-11-23 03:30 Zhentiw 阅读(524) 评论(0) 推荐(0) 编辑
摘要:Using Volta: volta pin node yarn In add into package.json: "volta": { "node": "14.15.1", "yarn": "1.22.10" } 阅读全文
posted @ 2020-11-20 04:11 Zhentiw 阅读(59) 评论(0) 推荐(0) 编辑
摘要:As simple as: npx gitignore node 阅读全文
posted @ 2020-11-20 04:03 Zhentiw 阅读(111) 评论(0) 推荐(0) 编辑
摘要:To display a sequence of values in React, we can use our mapSequence operator, wrap it around a broadcaster, then pass that new broadcaster into our u 阅读全文
posted @ 2020-11-19 01:46 Zhentiw 阅读(113) 评论(0) 推荐(0) 编辑
摘要:Instead of always combining useState and useEffect, when can create a utility useBroadcaster hook which allows us to pass in a broadcaster. export let 阅读全文
posted @ 2020-11-17 22:30 Zhentiw 阅读(125) 评论(0) 推荐(0) 编辑
摘要:Many streams of events end when a certain condition is met. When we run into that condition, we'll want to pass down our own custom values. This lesso 阅读全文
posted @ 2020-11-17 02:40 Zhentiw 阅读(141) 评论(0) 推荐(0) 编辑
摘要:function somethingRisky() {} try { somethingRisky() } catch(err: unknown) { if (err instanceof Error) { console.log(err.stack) } else { console.log(er 阅读全文
posted @ 2020-11-15 22:56 Zhentiw 阅读(78) 评论(0) 推荐(0) 编辑
摘要:Typescript v3.9 introduces the @ts-expect-error assertion added to TypeScript 3.9. This assertion is more descriptive than @ts-ignore because, rather 阅读全文
posted @ 2020-11-15 22:45 Zhentiw 阅读(1044) 评论(0) 推荐(0) 编辑
摘要:type Corner = `${'top' | 'bottom'}-${ 'left' | 'right'}` type VerticalAlignment = "top" | "middle" | "bottom"; type HorizontalAlignment = "left" | "ce 阅读全文
posted @ 2020-11-15 22:25 Zhentiw 阅读(170) 评论(0) 推荐(0) 编辑
摘要:...T: type Foo<T extends any[]> = [boolean, ...T, boolean] In previous typescript version, you can only put '...T' to the last element of array. Put n 阅读全文
posted @ 2020-11-15 22:19 Zhentiw 阅读(117) 评论(0) 推荐(0) 编辑
摘要:class Foo { #name; constructor(rawName?: string) { this.#name = rawName ?? (no name) } log() { console.log(this.#name) } } Checking 'rawName' is nulli 阅读全文
posted @ 2020-11-14 18:11 Zhentiw 阅读(108) 评论(0) 推荐(0) 编辑
摘要:Volta’s job is to manage your JavaScript command-line tools, such as node, npm, yarn, or executables shipped as part of JavaScript packages. Similar t 阅读全文
posted @ 2020-11-14 18:00 Zhentiw 阅读(107) 评论(0) 推荐(0) 编辑
摘要:First, let's see the code: // builder/Contact.java public class Contact { private String firstName; private String lastName; private String emailAddre 阅读全文
posted @ 2020-11-13 15:43 Zhentiw 阅读(88) 评论(0) 推荐(0) 编辑
摘要:It's common for a user to enter values that you want to check against your pre-defined values. Let's make a demo of a word game to demonstrate one app 阅读全文
posted @ 2020-11-12 15:56 Zhentiw 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Coding again the interface. interface: package com.frankmoley.lil.designpatternsapp.factory; public interface Pet { void setName(String name); String 阅读全文
posted @ 2020-11-11 17:38 Zhentiw 阅读(123) 评论(0) 推荐(0) 编辑
摘要:In previous post, we have follow code: const delayMessage = (message) => hardCode(message)(createTimeout(1000)); const sequence = (...broadcasters) => 阅读全文
posted @ 2020-11-11 16:46 Zhentiw 阅读(124) 评论(0) 推荐(0) 编辑
摘要:For example we have tow Entities: package com.virtualpairprogrammers.theater.domain import javax.persistence.* @Entity data class Performance( @Id @Ge 阅读全文
posted @ 2020-11-08 21:18 Zhentiw 阅读(114) 评论(0) 推荐(0) 编辑
摘要:pom.xml: add compile plugin <build> <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> <testSourceDirectory>${project.basedir}/src/ 阅读全文
posted @ 2020-11-06 03:38 Zhentiw 阅读(81) 评论(0) 推荐(0) 编辑
摘要:pom.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <gr 阅读全文
posted @ 2020-11-05 21:06 Zhentiw 阅读(123) 评论(0) 推荐(0) 编辑
摘要:We want to only freeze the private variable when we get it and set it: class Cart { #items; constructor(items = []) { this.value = items; } set value( 阅读全文
posted @ 2020-11-05 20:04 Zhentiw 阅读(74) 评论(0) 推荐(0) 编辑
摘要:Morden Javascript allows us to write private and static class memebers. To do this, we need to install babel plugins: First, let see "static member": 阅读全文
posted @ 2020-11-05 19:57 Zhentiw 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Let's see two code snippets which has same functionalities: No1: function Cart(items = []) { this.items = Object.freeze(items); this.add = item => { c 阅读全文
posted @ 2020-11-05 18:19 Zhentiw 阅读(76) 评论(0) 推荐(0) 编辑
摘要:https://epicreact.dev/css-variables/ Code body[data-theme='light'] { --colors-primary: deeppink; --colors-background: white; } body[data-theme='dark'] 阅读全文
posted @ 2020-11-05 03:56 Zhentiw 阅读(99) 评论(0) 推荐(0) 编辑
摘要:Structure: tempalates/seatBooking.html: <!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>com. 阅读全文
posted @ 2020-11-05 03:30 Zhentiw 阅读(161) 评论(0) 推荐(0) 编辑
摘要:In Java, you can use Autowired to init the service: @Autowired TheaterService theaterService In kotlin, it is different, you need to use 'lateinit var 阅读全文
posted @ 2020-11-05 03:17 Zhentiw 阅读(81) 评论(0) 推荐(0) 编辑
摘要:Many scenarios involve one task happening after another has completed. This lesson walks you through setting up "steps" which trigger one after anothe 阅读全文
posted @ 2020-11-04 20:09 Zhentiw 阅读(67) 评论(0) 推荐(0) 编辑
摘要:Backing bean: A typical JavaServer Faces application includes one or more backing beans, each of which is a type of JavaServer Faces managed bean that 阅读全文
posted @ 2020-11-04 01:55 Zhentiw 阅读(63) 评论(0) 推荐(0) 编辑
摘要:Install devtool: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <option 阅读全文
posted @ 2020-11-04 01:40 Zhentiw 阅读(97) 评论(0) 推荐(0) 编辑
摘要:ou can create diffs in markdown to show what has changed in a code snippet. I use this in blog posts to highlight changed lines for readers. This work 阅读全文
posted @ 2020-11-04 01:13 Zhentiw 阅读(68) 评论(0) 推荐(0) 编辑
摘要:Asynchronous code often uses conditions to determine when a block of code should finish running. This lesson walks through writing a doneIf operator w 阅读全文
posted @ 2020-11-04 01:07 Zhentiw 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Apps often have scenarios where one event controls another. In operators, this requires passing one broadcaster in and using it to control another bro 阅读全文
posted @ 2020-11-03 16:45 Zhentiw 阅读(89) 评论(0) 推荐(0) 编辑
摘要:After a broadcaster is "done", starting it up again requires calling the broadcaster with the same listener. This creates a kind of "async recursion" 阅读全文
posted @ 2020-11-03 01:22 Zhentiw 阅读(86) 评论(0) 推荐(0) 编辑
摘要:Controlling when a broadcaster starts and stops gives you complete control over your broadcasters. This let's you hook multiple pieces of UI together 阅读全文
posted @ 2020-11-02 19:26 Zhentiw 阅读(123) 评论(0) 推荐(0) 编辑
摘要:Chrome DevTools provide many handy utility functions that we can use to make debugging faster and easier so we can fix the bug and move on. In this le 阅读全文
posted @ 2020-11-02 16:30 Zhentiw 阅读(69) 评论(0) 推荐(0) 编辑
摘要:Sometimes you encounter a backend issue which seems to occur only on your computer, with a very specific sets of headers, cookies etc. Because of that 阅读全文
posted @ 2020-11-02 16:27 Zhentiw 阅读(100) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we use CSS variables with calc and hsl to implement a rudimentary dark mode. We can do this by adjusting the lightness of our colors b 阅读全文
posted @ 2020-11-02 16:22 Zhentiw 阅读(109) 评论(0) 推荐(0) 编辑
摘要:In Kotlin, you are able to extend a class. Just like add prototype in Javascript. fun toSentenceCase(a: String): String { return a[0].toUpperCase() + 阅读全文
posted @ 2020-11-01 22:20 Zhentiw 阅读(78) 评论(0) 推荐(0) 编辑
摘要:import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import java.util.* class AgeCalculation() { fun getAge(dob: Calendar): Int { 阅读全文
posted @ 2020-11-01 22:00 Zhentiw 阅读(149) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示