Сообщения

consul

The downside with choosing the "first address" is that in the case of a docker network overlay, the first ip will likely be the wrong one. It would be better if it would bind to all ip's on a given interface, if you don't want it to bind to all of them then the ip should be specified. Perhaps something like: --bind eth0 to bind to all ip's on a given interface --bind eth0;10.0.0.0/16 bind to any ip on a given interface that matches the given cidr. --bind eth0;10.0.0.5 bind to a specific ip on a given interface --bind 10.0.0.5 bind to a specific ip regardless of interface --bind 10.0.0.0/16 bind to a given ip that matches a cidr regardless of interface

CORS another one

devtools console helps: Access to XMLHttpRequest at 'http://localhost:8443/api/essay/6' from origin 'http://localhost:8082' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Access to fetch at 'http://localhost:8443/graphql' from origin 'http://localhost:8082' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. login:109 Access to fetch at 'http://localhost:8443/graphql' from origin 'http://localhost:8082' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on th...

@Transactional(propagation = Propagation.REQUIRES_NEW)

 @Transactional(propagation = Propagation.REQUIRES_NEW)     public BigDecimal getCurrentUserBonus(UserEntity user) { final Page<UserProfileDto> map = filtered.map(user -> {             UserEntity user2 = userService.fetchAllEagersUser(user);             BigDecimal currentUserBonus = userService.getCurrentUserBonus(user2);             user2.setCurrentBonusBalance(currentUserBonus);// it's async!!!!!!!!!!!             return new UserProfileDto(user2);         });

js.. what can I say more?

typeof null == 'object' typeof null === 'object' * let var = var2 ?? 'default_if_null'; * obj.mayNotExistFunc?.() - same as obj1?.obj2?.param1 obj1.mayNotExistArray?.[0] - check if it's non undefined and it's array * script defer - stay in header before dom elements used in script anbd it's work - no need to put it in the end of dom.  src: https://www.youtube.com/watch?v=v2tJ3nzXh8I&t=51&ab_channel=WebDevSimplified  * console.log("%c blabla %c blabla2", "color:red", "color:green"); todo https://www.youtube.com/watch?v=yJDofSGTSPQ&t=562s&ab_channel=WebDevSimplified 

postgres allow only one null value contrain

 The i_nulltest2 index allows only one y null value for each x value.  src: https://www.enterprisedb.com/postgres-tutorials/postgresql-unique-constraint-null-allowing-only-one-null 

и снова здрасьте - reactjs спустя годы - понаделали тут всякого понимашь!

https://stackoverflow.com/a/70937134/2910338 events - syntheticEvent - in reactjs events catches from root mount dom element. that's why propagation goes from top to bottom. на самом верхнем уровне где react app там ловятся все события и создается реакт SyntheticEvent - потом прежде чем всплывет к корню dom дерева проходит через них всех. event.stopPropagation(); src: https://blog.saeloun.com/2021/07/08/react-17-event-delagation.html  https://habr.com/ru/post/467361/ console.trace(); *************** error boundary( componentDidCatch) в хуках нет аналога хуки неззя юзать в классах хуки можно юзать только в react компонентах и в других хуках хуки неззя использовать в циклах и условиях тк значения хуков пишутся последовательно в массив внутри реакта. useCallback кеширует функцию  useMemo кеширует результат функции useCallback и useMemo не гарантируют что будут вызваны только при мутировании функции/данных - это лишь оптимизация производительности. const usePlanetName = (id) ...

algos

 public static T[] slice<T>(T[] l, int from, int to) {     T[] r = new T[to - from];     for (int i = from; i < to; i++)     {         r[i-from]=l[i];     }     return r; } src: https://stackoverflow.com/a/32965043/2910338