In these quarentine days I’am getting some progress in sql. I nearly completed the database design, but still there is some standardization issues that I’am working on it. It be use by any small scale technology companies for storing and managing technical sales, stock tracking, client info and technical service records. Mysql forces me a lot because of its relational structure but it is fine, I’am learning and practicing lots of things, such as constraints, views, procedures, triggers and functions. The finishing can take one day more, I attached current enhanced entity-relationship diagram of it.
Recently I setup an OpenVPN server on my remote Ubuntu Server (18.04) for all my internet traffic. After completing all the steps, I have done some extras for both of the client and server side machines. Also, my wifi access point-router needs an adjustment for handling TLS handshaking process.
First things first I have enabled and assigned the floating-ip to the droplet and setup the server like this. Then, I have found my anchor-ip with
The two packages are similar, but provide slightly different functionality. If you only install iptables-persistent, you won’t get the service definition file for correct handling in systemd, eg /lib/systemd/system/netfilter-persistent.service. If you only install netfilter-persistent, you will find that rules are not correctly applied at boot.
Rules can be saved in a file with the (root) command iptables-save for IPv4:
iptables-save > /etc/iptables/rules.v4
These files can be loaded again with the command iptables-restore for IPv4.
iptables-restore < /etc/iptables/rules.v4
Recent versions of iptables-persistent have two configuration files: /etc/iptables/rules.v4 for the IPv4 ruleset, and /etc/iptables/rules.v6 for the IPv6 ruleset.
Inversion of Control Containers and the Dependency Injection pattern
Explaining the Dependency Injection pattern, by contrasting it with Service Locator. The choice between them is less important than the principle of separating configuration from use.
Wicked Problems And Social Complexity – Jeff Conklin
This book is about collective intelligence: the creativity and resourcefulness that a group or team can bring to a collaborative problem.
Program Development by Stepwise Refinement – Niklaus Wirth
The creative activity of programming to be distinguished from coding is usually taught by examples serving to exhibit certain techniques. It is here considered as a sequence of design decisions concerning the decomposition of tasks into subtasks and of data into data structures. The process of successive refinement of specifications is illustrated by a short but nontrivial example, from which a number of conclusions are drawn regarding the art and the instruction of programming.
What Every Computer Scientist Should Know About Floating-Point Arithmetic
This paper presents a tutorial on those aspects of floatingpoint that have a direct impact on designers of computer systems. It begins with background on floating-point representation and rounding error, continues with a discussion of the IEEE floating-point standard, and concludes with numerous examples of how computer builders can better support floating-point.
Design by contract
It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as “contracts”, in accordance with a conceptual metaphor with the conditions and obligations of business contracts.
Separation of concerns
In computer science, separation of concerns (SoC) is a design principle for separating a computer program into distinct sections such that each section addresses a separate concern. A concern is a set of information that affects the code of a computer program. A concern can be as general as “the det…
Linguistic relativity
The hypothesis of linguistic relativity, part of relativism, also known as the Sapir–Whorf hypothesis , or Whorfianism is a principle claiming that the structure of a language affects its speakers’ world view or cognition, and thus people’s perceptions are relative to their spoken language.
Engineering and Computer Science: Time to Separate?
A program written in an assembly language that implements the following Java code look like the one:
int thomas = 3, sylvester = 7, cats;
cats = thomas + sylvester;
Symbol Opcode Operand
------------------------------
SAMPLE START FIRST Line 1
THOMAS WORD 3 Line 2
SYLVESTER WORD 7 Line 3
CATS WORD ? Line 4
FIRST LOAD THOMAS Line 5
ADD SYLVESTER Line 6
STORE CATS Line 7
STOP Line 8
END Line 9
The program adds two numbers 3 and 7 that are in the variables THOMAS and SYLVESTER respectively, and stores the result 10 in the variable CATS. The column labels, the line below the column labels, and line numbers are not part of the program but included to show how the words line up. In order from left to right, the three fields of an instruction are the symbol, the operation code (opcode), and the operand. The first field is typically reserved for the names of variables or labels for instructions. The second field is typically used for opcodes that represent executable instructions and also assembler directives which tell the assembler what to do. The third field is used for operands.
The first line indicates the start of the program. The symbol SAMPLE is the name of the program, the opcode START tells the computer when the program starts, and operand FIRST indicates the location of the first instruction. The second through fourth lines are directives that tell the assembler to reserve the memory locations. Line 2 reserves a space for the symbol THOMAS which is initialized to 3. Similar to the second line, the third line initializes the variable SYLVESTER to 7. The fourth line reserves an uninitialized memory location called CATS. Line 5 fetches the contents from the memory location THOMAS and stores it into a register. A register is a memory location in the CPU where among other things arithmetic can be performed. Then the ADD operation in Line 6 gets the value from the variable SYLVESTER and adds it to the contents of the register. The next line stores the value in the register into the memory location CATS. The STOP instruction halts the execution of the program. In the last line, the END directive indicates to the assembler the end of the program.
The Problem: Given a dictionary of words in English, find all the anagrams in the dictionary. That is, find all the words that are permutations of each other. For example, pots, stop, and spot are anagrams of each other.
Bentley, J. Programming Pearls, Second Edition. (Boston, MA: Addison-Wesley, 2000.)
First of all, all the anagrams have the same letters and the same number of letters in each word. That gives us the clue to the method you’ll use to find the anagrams. If you sort each word by individual letters, you’ll end up with a string of characters that has all the letters in the word in alphabetical order. We call this creating a sign for the word. If you then sort the resulting list, all the anagrams will end up together in the sorted list because their sorted letters will be identical. If you then keep track of which words you sorted, you can then simplify the list and create a new list with, say, each set of anagrams on the same line of the output file. This is exactly how Bentley does it. But how does this relate to a pipe-and-filter architecture, you ask? Good question. Let’s break down the solution again.
Create a sign for each word in the list by sorting the letters in each word; keep the sign and the word together.
Sort the resulting list by the signs; all the anagrams should now be together.
Squash the list by putting each set of anagrams on the same line, removing the signs as you do.
sign <dictionary.txt| sort | squash> anagrams.txt
sign is the filter we use to do step 1, with input file dictionary.txt. sign outputs a list of signs and their associated words, which is piped to the sort utility. Sort then sorts the list by the first field on each line, which happens to be the sign of each word. It then outputs the sorted list to the next pipe. Squash takes the sorted list from the incoming pipe and compresses it by putting all the words with the same sign on the same line, eliminating the signs as it does so. This final list is sent via one last pipe to the output file anagrams.txt.
Anagram Program (The GNU Awk User’s Guide)
Column 2, Problem C, of Jon Bentley’s Programming Pearls, Second Edition, presents an elegant algorithm. The idea is to give words that are anagrams a common signature, sort all the words together by their signatures, and then print them. Dr. Bentley observes that taking the letters in each word and sorting them produces those common signatures.