Sample traffic capture (loopback0 interface, port 11280, pcap format understandable by wireshark):
tcpdump -i lo0 -v -X port 11280 -s0 -w ~/Downloads/traffic1.pcap
Sample traffic capture (loopback0 interface, port 11280, pcap format understandable by wireshark):
tcpdump -i lo0 -v -X port 11280 -s0 -w ~/Downloads/traffic1.pcap
// NOTE: two approaches are possible here, one uses jquery abstractions (and works on pretty old browsers), | |
// while the other uses insertAdjacentHTML, the standard API in all the modern browsers (and old IEs too!). | |
// | |
// First approach (jquery way): | |
const $element = $($.parseHTML(htmlString)); | |
$element.appendTo($container); | |
// Other approach (HTML, works on modern browsers): | |
$container.each(function () { this.insertAdjacentHTML('beforeend', htmlString); }); |
The biggest pain of using spring is its heavy use of classloaders...
This is something that happens with me when I try to use custom version of jackson:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/util/DefaultIndenter
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1116)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1060)
at org.springframework.beans.factory.support.AbstractAutowire
The principles of good programming are closely related to principles of good design and engineering. The following programming principles have helped me over the years become a better programmer, and I believe can help any developer become more efficient and to produce code which is easier to maintain and that has fewer defects.
This is probably the single most fundamental tenet in programming is to avoid repetition. Many programming constructs exist solely for that purpose (e.g. loops, functions, classes, and more). As soon as you start repeating yourself (e.g. a long expression, a series of statements, same concept) create a new abstraction. http://en.wikipedia.org/wiki/Don%27t_repeat_yourself
# Build environment image | |
# Do the following to build and run: | |
# docker build -t bld-centos-7 . | |
# Once image is built, you can run it: | |
# docker run -it bld-centos-7 /bin/bash | |
# The same, but with mounted 'proj' folder: | |
# docker run -it --mount type=bind,source="$(pwd)"/proj,target=/proj bld-centos-7 /bin/bash | |
# The same, also initializes systemd and maps gopath's src into /goproj/src: | |
# docker run -d -e=container=docker --stop-signal=SIGRTMIN+3 --cap-add=SYS_ADMIN --security-opt=seccomp:unconfined -v /sys/fs/cgroup:/sys/fs/cgroup:ro --mount type=bind,source=$GOPATH/src,target=/goproj/src bld-centos-7 /sbin/init |
This is insecure, fast-to-setup setup of simple master-slave replication with dockerized PostgreSQL installation.
Note, that below works with version postgres version 12.2
: postgres (PostgreSQL) 12.2 (Debian 12.2-1.pgdg100+1)
.
Preparation:
# This is where your primary database files will be stored
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import java.awt.Canvas; | |
import java.awt.Color; | |
import java.awt.Graphics2D; | |
import java.awt.event.WindowAdapter; | |
import java.awt.event.WindowEvent; | |
import java.awt.image.BufferStrategy; | |
import java.awt.image.BufferedImage; | |
import java.io.File; |