Symptoms You may receive the following error message when you create a FOREIGN KEY constraint: (microsoft report) 1 Server: Msg 1785, Level 16, State 1, Line 1 Introducing FOREIGN KEY constraint 'fk_two' on table 'table2' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Server: Msg 1750, Level 16, State 1, Line 1 Could not create constraint. See previous errors. For example, the table definition is like this: 1 2 3 4 5 6 7 8 Table t1: Id: primaryKey Table t2: Id: primaryKey parent: Fore
Read more »

playing-nhibernate-inverse-and-cascade, nhibernate-inverse bidirectional associations In database, there may be biodirectional relationships, e.g. Parent has multiple child, and Child has a parent. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #### class definition class Parent: - String id - IList childs class Child: - String id - Parent parent #### db definition table Parent: - id table Child: - id - parentId Inverse Inverse focus on the association. It defines which side is responsible of the association maintenance (create, update, delete), that is, the
Read more »

the great video History Why does we create internet? It’s created from the need of American military, to protect the communication in the wars. The old communication system, phone, connects Lily with Tom through fixed central offices. If some of the central offices are destroyed by nuclear, then the rerouting of the communication line is difficult, that the commnunication will fail. Ta Da.. Internet comes. It communicates through millions of routers. Even half of the routers are destroyed, there may still be the way to communicate. Why does we create VPN (virtual private network)? Interne
Read more »

nginx 502 和 504 超时演示 502 Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server. 504: he server was acting as a gateway or proxy and did not receive a timely response from the upstream server. Conclusion 504 是 nginx 没有及时从上游服务获取响应,超时了: * 上游服务响应慢,读取 response / 发送 request 超时(upstream timed out (110: Operation timed out) **while** reading response header from upstream) * 某些请求处理就是慢。此时就应该调大 proxy_read_timeout (默认 60s) * 上游服务压力太大,响应变慢。此时可以增加上游服务的响应能力,也可以适当提升 proxy_send_timeout, proxy_read_timeout * 连接上游服务超时。可能是上游服务已经断了,但由于
Read more »

yield is a contextual keywords. When it shows in a statement, it means the method or get accessor in which it appears is an iterator. Thus it provides a simple way to define an iterator, rather than a class that implements IEnumerable or IEnumerator. When you use the yield contextual keyword in a statement, you indicate that the method, operator, or get accessor in which it appears is an iterator. Using yield to define an iterator removes the need for an explicit extra class (the class that holds the state for an enumeration, see IEnumerator for an example) when you implement the IEnumerable
Read more »

FluentValidation Knowledge * The RuleFor method create a validation rule. To specify a validation rule for a particular property, call the RuleFor method, passing a lambda expression that indicates the property that you wish to validate. * Rules are run syncronously By default, all rules in FluentValidation are separate and cannot influence one another. This is intentional and necessary for asynchronous validation to work. * Must, NotNull…. are built-in validators. WithMessage is a method on a validator. When defines condition for validator(s). * Append multiple validators on a same
Read more »

.net, asp.net, c# c# is like java language specification; .net is like jdk/javase/javaee asp.net: is like springboot 1. default, as, is 2. sln: solution ——> csproj: c sharp project ——> files .sln vs .csproj Key concepts ref: c# concepts * solution: a complete application, similar to maven project. It contains several c# project like frontend, backend, library to compose a complete application. * project: similar to maven module. It can be a web project, a library, a windows program, etc. * assembly: similar to maven jar. A c# project is corresponding to an assembly. An assembly can b
Read more »

why REST? The World Wide Web is arguably the world’s largest distributed application. Understanding the key architectural principles underlying the Web can help explain its technical success and may lead to improvements in other distributed applications, particularly those that are amenable to the same or similar methods of interaction. REST contributes both the rationale behind the modern Web’s software architecture and a significant lesson in how software engineering principles can be systematically applied in the design and evaluation of a real software system. —- Fielding’s REST dissertati
Read more »

great free learning website with quiz great online editor & debugger Python学习资料/文章/指南整理 Zen of Python By typing import this, you can see the zen of python. Some need more explanation: Explicit is better than implicit: It is best to spell out exactly what your code is doing. This is why adding a numeric string to an integer requires explicit conversion, rather than having it happen behind the scenes, as it does in other languages. Flat is better than nested: Heavily nested structures (lists of lists, of lists, and on and on…) should be avoided. Errors should never pass silently: In general,
Read more »

k8s is a platform to manage containerized workloads and services. Concepts kubernetes Objects 1. Kubernetes abstract a desired state of cluster as objects. 2. an object configuration includes: 1. spec: describe the desired state 1. apiVersion: the api version of kubernetes 2. metadata: the name & namespace 3. spec: the desired state definition. 2. status: describe the actual state of the object 3. cluster state (understanding kubernetes objects): 1. what containerized applications are running and where they’re running 2. how many reso
Read more »
0%