How to document dependencies between various entities in the system

I’m trying to model/document very broadly understood dependencies between various component of deployed system. I could document each type of dependency separately, but I’d like to provide full overview, possibly very complicated, but in single place and ideally with ability to group entities by type. The following is an example of a system that I’d like to document:

  • RDBMS, let’s say PostgreSQL
  • CLIENT – Java-based data gathering service uploading information to the database
  • SERVER – Java-based web application visualizing data from the database

I’d like to provide the following data:

  • RDBMS is an external application, installed using file postgres-9.msi, on server 192.168.1.2, on Debian Linux 9.6, listening on port 5432, running as user ‘postgres’
  • CLIENT is developed internally, installed using file client-1.0.deb, on server 192.168.1.3, on Debian Linux 9.6, running as user ‘client’, requires JAVA8, connects to RDBMS
  • JAVA8 is an external application, installed using file jre-8u201.exe, is installed only as a dependency, installable on Windows10 and Debian 9.6
  • SERVER is developed internally, installed using file server-1.0.deb, on server 192.168.1.4, on Debian Linux 9.6, running as user ‘server’, requires JAVA8, connects to RDBMS, listens on 443

What I’d like to see is e.g. a web page with information such as:

  • servers – system, address, ports, software
  • systems – version, servers where it is installed
  • software – servers where it is installed, binary used for installation, version
  • binaries – what system and other software is required
  • addresses – what ports are opened, which server it is
  • ports – addresses on which this port is opened, software that opened this port

… and so on and so forth.

Is there any software capable of reading such information in any format and create its representation in tabular format?

I use Enterprise Architect, but unfortunately I’m still not good enough at it so not only I’m unable to create such diagram with appropriate report, I don’t even know if it is possible at all.

Site selling lists with importers from various countries

The website sells lists with importers from all over the world, lists which have been manually compiled. Curently the site sells lists with importers from Spain, Italy, India and China. I can assist you in adding more lists, in case you have them. The website owner doesn't have to intervene in the selling process, as everything is automated. The buyer pays for the list and gets instant access.

Why are you selling this site?

I am involved in too many projects

How is it…

Site selling lists with importers from various countries

Setting up a local email server as a central store for various external email accounts

Currently (and for decades), I have had my email set up in the following way: I have a local email client (Thunderbird) on my desktop machine. I have several external email accounts with my ISP, Google, etc. etc. My local email client goes to those external accounts directly and (preferably) uses POP3 to download the mail, and delete it from the external server. In some cases, IMAP is used instead. However, I really like keeping all of my mail eternally, and really dislike keeping it eternally on an external server, so I prefer POP3 on the external servers if possible.

For various reasons, I am thinking of changing so that I instead run an IMAP server on a computer on my personal network. It would handle collecting email from all of the external accounts, and stuffing it into local accounts. I would then change Thunderbird to access the local accounts (via IMAP, not POP3) instead of the external accounts, and I would make some little cron job to periodically delete (say) month-old email from the external servers.

I’ve been reading to try to figure out how to accomplish this, and I have a high-level plan. But I’ve been finding this all a bit complicated, so I’m not really all that confident that my plan is not abysmally bad. So, I’d like to describe what I intend to do, hoping for feedback on whether or not I’m on the right track, and also to ask some specific questions to make sure that I’m understanding things correctly. My plan is this:

(1) On one of my computers, set up an IMAP server (I’m leaning towards Dovecot).

(2) For each external email account (say, bob@foo.bar), set up a corresponding local email account on Dovecot (say, bob_foo_bar@mygreatserver.local).

(3) Set up something like getmail so that for each such external/local pair, getmail logs into (say) bob@foo.bar, pulls any new mail, and delivers it to bob_foo_bar@mygreatserver.local.

(4) In Thunderbird, set up an IMAP client account for each local account such as bob_foo_bar@mygreatserver.local.

(5) In Thunderbird, associate each such IMAP account with the SMTP account of the associated external account such as bob@foo.bar.

(6) For backup purposes, an automatic script to dump the local IMAP server’s database.

(7) Also for backup purposes, an automatic script using something like OfflineIMAP as an intermediary between the local IMAP server and storing actual Maildir stuff in a Subversion repository.

(8) An automatic script to delete old email from the external servers.

So… does that all sound reasonable? Anything wrong with it? Am I missing something? Any better suggestions? A few specific things I am worried about:

(A) This is, I think, my greatest concern: Am I correct in thinking that when my script deletes old mail from the external servers, that will NOT cause it to also be deleted from the local server? Even if getmail is accessing the external account via IMAP?

(B) The reason I (think I) want to use the external SMTP servers is that I want emails that I send to come from (say) bob@foo.bar, not from bob_foo_bar@mygreatserver.local. Is this the correct way to accomplish that? Or should I be setting up a local SMTP server (like Postfix) and somehow using it as a bridge to the external SMTP servers?

(C) What about saving sent emails? I am imagining that it would be more or less automatic just based on what I described above: Thunderbird sends an email to the SMTP server at foo.bar. The email system on foo.bar is a black box that somehow sticks a copy of it into a “Sent” folder accessible via IMAP. Getmail sees that new message on the external server, and treats it just like any message it sees: It delivers it to the local IMAP server, which puts it into a local Maildir folder called “Sent”. Thunderbird sees that Maildir folder (via IMAP), and treats it just like it treats every such folder: It displays it and its contents to me. Is that all correct? If not, how do I save sent mails?

Thanks in advance for any help.

combining various lines of code for a single desktop application in c# [on hold]

So I’ve been trying to learn to code in c# for about two or three weeks now. As a project I came up with a calculator program. Now I’m trying to convert it into a desktop application. I have it to where all the basic operations work (+,-,* and /). In the program I can also raise the first number to the power of the second number for example: num1 * num1 num2 times(so if num1 = 3 & num2 = 4) == 3 * 3 * 3 * 3

Now I’m trying to figure out how to get this function to work in the new application.

In the program the code for basic operators is: else if (op == “+”) { Console.WriteLine(“num1 + num2); } It’s pretty copy and paste for all four operations. the only thing that changes is the operator between all four.(+,-,* & /)

In the new code for the desktop version the basic operators are written like this: case “+”; textBox_Result.Text = resultValue + Double.Parse(textBox_Result.Text)).ToString(); break; And again it’s pretty copy and paste for all four operations. The only difference is the operator being added to the couple lines of code.

To get the first number raised to the power of the second number in the original code I wrote it like this: else if (op == “^”) { double result = 1; for (double i = 0; i < num2; i ++;) { result = result * num1; } Console.WriteLine(“result”); }

For the new application I came up with:

case “^”; double result = 1; for (double i = 0; textBox_Result.Text; i ++;) { result = result * resultValue; } textBox_Result.Text = Double.Parse(textBox_Result.Text)).ToString; break;

Does anyone know if this looks right or not? Thanks for any help.

Parse a date in various formats

I have a problem similar to the question, namely reading in text which describes a date – in various formats. I want to use the parseTimeM function from Date.Time module in time package.

My current solution can probably be improved style wise but it should remain easy to read and easy to extend. Suggestion?

readDate3 :: Text ->   UTCTime readDate3 datestring  =      case shortMonth of         Just t -> t         Nothing -> case longMonth of             Just t2 -> t2             Nothing -> case monthPoint of                 Just t3 -> t3                 Nothing -> case germanNumeralShort of                   Just t3 -> t3                   Nothing -> case germanNumeral of                     Just t3 -> t3                     Nothing -> case isoformat of                       Just t4 -> t4                       Nothing -> errorT   ["readDate3", datestring, "is not parsed"]      where         shortMonth = parseTimeM True defaultTimeLocale             "%b %-d, %Y" (t2s datestring) :: Maybe UTCTime         longMonth = parseTimeM True defaultTimeLocale             "%B %-d, %Y" (t2s datestring) :: Maybe UTCTime         monthPoint = parseTimeM True defaultTimeLocale             "%b. %-d, %Y" (t2s datestring) :: Maybe UTCTime         germanNumeral = parseTimeM True defaultTimeLocale             "%-d.%-m.%Y" (t2s datestring) :: Maybe UTCTime         germanNumeralShort = parseTimeM True defaultTimeLocale             "%-d.%-m.%y" (t2s datestring) :: Maybe UTCTime         isoformat = parseTimeM True defaultTimeLocale             "%Y-%m-%d" (t2s datestring) :: Maybe UTCTime 

Extending a data class consumed in various place because one of the consumers requieres a new filed

I have a class A that is the return type of an process (let’s call it M.getData()) that is consumed by several procedures through the code base (lets call them P1,P2 and P3). This class A is part of a third party library that I can’t modify and is populated with data coming from a XML response from an external service. Up until now the XML file came with some extra data that was ignored, but now it is required only in the procedure P1. Since I can’t touch the A class, would it be a good practice to extend class A (A_Ext), change return type of M from A to A_Ext and handle the new requirement in P1 while letting P2 and P3 still use class A through an implicit casting like A var1 = M.getData() that now returns A_Ext?

The code base is in Java.

What are the various auto launch paths mean in OSX?

I’m trying to track down sneaky apps that launch upon reboot. They are not in System Preferences > Users and Groups > Login items and the in-app preferences for auto starting is disabled too for them. I did find them here:

~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons 

What do each folder mean? Does removing the file from here simply mean the OS is won’t find it on startup?

code is duplicated to meet various conditions

The use case that this code tries to meet is

There will be an interview session where the video calling is done between two participants, interviewer(ER) and interviewee(EE) For this i need to have a video element and reference that video element using ref. For ER its a localStreamRef and for EE its remoteStreamRef. To use ref, i need to have that video element already because attaching the stream in the video element is done inside componentDidMount by listening to the sockets from there.

The conditions that i have to fulfill is, if the event is

  1. event1 – Show ER and EE screen
  2. event2 – Only EE screen
  3. event3 – Only ER screen
  4. event4 – ER, EE and Screen Recording screen(this is also a video element)
  5. event5 – ER and SS
  6. event6 – EE and SS
  7. event7 – SS only

To achieve this i did the code following way but its too much repeated

import React from "react"; import isElectron from "is-electron"; import styled from "styled-components";  const Wrapper = styled.div``;  const PowerPoint = styled.div`   color: #fff;   text-align: center;   background: #2d3561;   position: relative;   & > video {     position: absolute;     top: 0;     left: 0;     width: 100%;     object-fit: cover;   } `;  const VideoPanel = styled.video`   max-width: 100%;   width: 400px;   height: auto;   transition: all 0.3s ease;   transform: rotateY(180deg);   -webkit-transform: rotateY(180deg);   -moz-transform: rotateY(180deg);   $  {props =>     props.left &&     `     position: absolute;     bottom: 50px;     left: 50px;     z-index: 1;     transition: all 1s ease;     width: 400px;   `};   $  {props =>     props.right &&     `     position: absolute;     bottom: 50px;     right: 50px;     z-index: 1;     transition: all 1s ease;   `}   &.fullscreen {     position: absolute;     top: 0;     left: 0;     transform: translateY(0);     width: 100%;     height: 100%;   } `; const VideoPanels = styled.div`   width: 100%;   height: auto;   position: absolute;   top: 80%;   left: 0;   width: 100%;   transform: translateY(-50%);   transition: all 0.3s ease;   &.fullscreen {     position: absolute;     top: 0;     left: 0;     transform: translateY(0);     $  {VideoPanel} {       width: 100%;       height: 100%;     }   } `;  const user = JSON.parse(localStorage.getItem("user"));  const Studio = ({ interviewer, interviewee, ...props }) => {   const [hotkeys, setHotkeys] = React.useState("event4");   React.useEffect(() => {     return () => {       window.ipcRenderer.removeAllListeners("eventListened");     };   }, []);   React.useEffect(     () => {       console.log("user", user);       console.log(         "remoteJoined",         props.isRemoteJoined,         user !== null && user.data.isInterviewer       );       if (         isElectron() &&         props.isRemoteJoined &&         (user !== null && user.data.isInterviewer)       ) {         window.ipcRenderer.on("eventListened", (event, hotkeys) => {           setHotkeys(hotkeys);         });       }     },     [props.isRemoteJoined]   );   const renderVideo = () => {     switch (hotkeys) {       case "event1":         return (           <React.Fragment>             <PowerPoint style={{ display: "none" }}>               <video autoPlay id="screenshare" style={{ display: "none" }} />             </PowerPoint>              <VideoPanel               ref={interviewer}               autoPlay               muted="muted"               id="local-media"               left             />             <VideoPanel               ref={interviewee}               autoPlay               muted="muted"               id="remote-media"               className="fullscreen"             />           </React.Fragment>         );       case "event2": {         return (           <React.Fragment>             <PowerPoint style={{ display: "none" }}>               <video autoPlay id="screenshare" style={{ display: "none" }} />             </PowerPoint>             <VideoPanel               ref={interviewer}               autoPlay               muted="muted"               id="local-media"               style={{ display: "none" }}             />             <VideoPanel               ref={interviewee}               autoPlay               className="fullscreen"               id="remote-media interviewee-for-now"             />           </React.Fragment>         );       }       case "event3": {         return (           <React.Fragment>             <PowerPoint style={{ display: "none" }}>               <video autoPlay id="screenshare" style={{ display: "none" }} />             </PowerPoint>             <VideoPanel               ref={interviewer}               autoPlay               muted="muted"               className="fullscreen"             />             <VideoPanel               ref={interviewee}               autoPlay               id="remote-media"               style={{ display: "none" }}             />           </React.Fragment>         );       }       case "event4": {         return (           <React.Fragment>             <PowerPoint>               <video autoPlay id="screenshare" />             </PowerPoint>             <VideoPanel ref={interviewer} autoPlay muted="muted" left />             <VideoPanel ref={interviewee} autoPlay id="remote-media" right />           </React.Fragment>         );       }       case "event5": {         return (           <React.Fragment>             <PowerPoint>               <video autoPlay id="screenshare" />             </PowerPoint>             <VideoPanel ref={interviewer} autoPlay muted="muted" />             <VideoPanel               ref={interviewee}               autoPlay               id="remote-media"               style={{ display: "none" }}             />           </React.Fragment>         );       }       case "event6": {         return (           <React.Fragment>             <PowerPoint>               <video autoPlay id="screenshare" />             </PowerPoint>             <VideoPanel               ref={interviewer}               autoPlay               muted="muted"               style={{ display: "none" }}             />             <VideoPanel ref={interviewee} autoPlay id="remote-media" />           </React.Fragment>         );       }       default:         return (           <React.Fragment>             <PowerPoint>               <video autoPlay id="screenshare" />             </PowerPoint>             <VideoPanels               className={                 hotkeys === "event2" || hotkeys === "event3" ? "fullscreen" : ""               }             >               <VideoPanel ref={interviewer} autoPlay muted="muted" />               <VideoPanel ref={interviewee} autoPlay id="remote-media" />             </VideoPanels>           </React.Fragment>         );     }   };   console.log("hotkeys", hotkeys !== "event1");   return (     <React.Fragment>       <Wrapper>{renderVideo()}</Wrapper>     </React.Fragment>   ); };  export default Studio; 

My question is, in the renderVideo, the code are too much duplicated due to many conditions. The styling to show the screen is done in that way. How can this code be refactored to make it clean and remove code duplication?

Are there any good resources that provides information about the focus breathing of various lenses?

Sites like DxOMark provides a lot of information about lenses but they generally don’t provide any really usable information about the focus breathing protperties of the lenses. In fact I don’t know a single website or other source that systematically tests and presents the focus breathing properties of lenses at different focus distances.

Are there any good resources that provides this information?

Comparison of build times on various hardware; why non-linear results?

  • Why do the compile times not vary significantly between different era CPUs, even though disk (NVMe vs. HDD) and CPU benchmarks vary significantly in performance?
  • Why does disabling hyperthreading affect performance significantly with the Ryzen CPU?

Over the past few months I have seen some different machines all running Linux with CPUs that varied from about 9 years since release and some recently released. The newer CPUs received much higher benchmark numbers from cpubenchmark.net. Details below including compile times for the Linux 4.4.176 kernel using Ubuntu 18.04.

To put it simply, CPUs that scored multiple times faster at cpubenchmark.net most certainly did not decrease compile times by the same factor. In fact, sometimes meager improvements were seen.

What would be the bottleneck to change or fix? The Ryzen machine has all the latest hardware gadgets. Or is this a case of synthetic benchmarks vs. reality?

This question touches on the topic of benchmarking by compile time comparison, but does not explore the (lack of) variability in build times seen.

  • Recent Ryzen 2950X system
    • Single Thread Rating: 2208
    • Disk: NVMe
    • Source: Linux kernel, 4.4.176, compiled with .config from Ubuntu Xenial
    • Invocation: make -j32
    • Compile time: 25997u 4910s 17:25 wall time
  • Same system, with hyperthreading (or whatever AMD calls it) turned off
    • Source: Linux kernel 4.4.176, same .config file
    • Invocation: make -j16
    • Compile time: 10561u 1796s 13:44 wall time

That is an over 20% reduction in compile time amounting to a difference of 3 minutes 41 seconds, from 17:25 to 13:44. Just by disabling the hyperthreading feature.