## means – Probability of observing a certain amount of arrivals in an interval

I’m told the mean rate of arrivals in a facility is 10 per minute.

I’m asked to find the probability that more than 2 arrivals occur within 10 seconds.

I know that $$P(>2$$ arrivals$$) = 1-P(<=2$$ arrivals$$)$$ but since the interval is 10 seconds and not 60 I’m a bit confused.

If they asked what the probability of more than 2 arrivals in 60 seconds was I could just use the Poisson table.

In order to answer this question do I just convert my mean rate? So instead of 10 per minute it could be $$10/6$$ arrivals per 10 seconds and then use the poisson table?

I’m just a bit confused on what to do when the mean rate is given as ‘per minute’ and the question is only looking at a 10 second interval.

I hope I’ve explained it well enough, any help would be appreciated.

## clean code – What does “If a function does only those steps that are one level below the stated name of the function, then the function is doing one thing” means?

The fact that you were able to so easily make that list of bullet points is of relevance here 🙂

This question might be considered opinion based, but this is about levels of abstraction. The concept may appear too academic, almost intimidating, but it just refers to the level of detail with which you express things, and the choice of particular detail you include – and this depends on who are you talking to and why.

E.g., in an informal scenario, if someone asks you “When will you be available?”, there’s a difference between you answering “I’ll get back to you in a week.” and “Oh, man, I’m traveling, I’m going to this rock concert, the stage is within this medieval fortress, and I’ve heard so many good things from people, it’s going to be such a blast, you’re never going to believe who’s playing (etc., etc.)!”. In the second case, the person who asked the question might be able to extract the information relevant to them eventually, but the first level of abstraction is likely preferred – e.g., in a business scenario (where the person is busy and they just want to understand when you’ll be available). Similarly, if someone asks you “Where are you going?”, but from the context, it’s clear to you that they aren’t interested in all the detail, you could just say “To a rock concert in Hungary” – thus making a different choice of the relevant details.

In software, you’re expressing behavior using functions, and you’re faced with similar choices, creating conceptual levels of abstraction. This is in part for the benefit of the readers of your code (other programmers, or future you), and in part for organization and maintainability. So, the exact natures of “level of abstraction”, and “one thing”, or “single responsibility” are necessarily somewhat up to you and depend on the particular problem you’re trying to solve with your program. You try to identify different axes of change and divide responsibilities according to that, on a multiple hierarchical levels of abstraction (you may need to continue to refactor towards this as you work on the project – this is not something you’re going to get completely right from the very start).

Now to the core of your question:

In this function I can see, it doing three different things:

• Determining whether the page is a test page.
• If so, including setups and teardowns.
• Rendering the page in HTML.

What this function is doing is orchestrating those other functions which are one level of abstraction below. Its job is to put them together and decide what gets called when. Those other functions are doing the actual, individual things.

The same idea applies recursively, within those lower-level functions as well.

But Uncle Bob says:
“If a function does only those steps that are one level below the stated name of function, then the function is doing one thing.”

I’m pretty sure that’s what he means here. As a rule of thumb, if a function is only orchestrating functions that are one abstraction level below it, then there’s a good chance it’s doing a single thing. Also, the code is more declarative (you can almost read it as a sentence – as you’ve demonstrated by creating your list of bullet points to which it maps almost 1-to-1), and it doesn’t dig down into the lower level concerns that are not its business (otherwise you’d have to mentally parse a bunch of if-s or loops and strangely named variables to even figure out what is the high-level thing the function is trying to do – this corresponds to the situation described at the start, where a blabbering answer is given to a higher-level question).

On the next page, Uncle Bob says: “We want the code to read like a top-down narrative”. This is, more or less, the idea he’s describing there.

## genesis block – Is the coinbase transaction the one and only means of minting new coins?

Is the coinbase transaction the one and only means of minting new coins?

Yes.

Is the coinbase transaction implicated in anyway in the creation of the first initial suppy of bitcoins or the creation of the genesis block?

Yes. Bitcoin was not premined, which means that there was no initial supply created by the creator. All of the Bitcoin in existence came from coinbase transactions produced in the blocks after the genesis block. Additionally, the coins created in the genesis block are also unspendable, so do not actually count to the total Bitcoin supply.

Since coinbase transaction blocks don’t include any previous transaction history (except reward transaction to the miner), is it less computationally expensive to mine than blocks with actual transactions?

Technically yes, but the extra computation required is basically negligible. Building a block requires hashing all of the transactions into the merkle root. The more transactions there are, the more hashes that need to be computed. However this only adds a few thousand hashes at worst, so the effect is basically negligible. It can be computed in a second or two at worst.

And does this expense grow with the size of the blockchain or is it constant?

The blockchain being longer has no effect on how difficult it is to mine blocks.

## probability – Going “well into the lifetime” of a renewal process means the time until the next event will be uniform conditional on inter-arrival?

Blackwell’s theorem (theorem 4.6.2 here) on renewal processes says (for non-arithmetic renewal processes) that if $$m(t)$$ is the average number of events occurring from the start of the process to time, $$t$$ and $$delta$$ is any positive real number,

$$lim_{tto infty} (m(t+delta)-m(t)) = frac{delta}{E(X)}$$

Here, $$E(X)$$ is the mean time between events for the process. In words, if you go “well into the lifetime” of a renewal process and count the number of events in an interval of length $$delta$$, you will count on average $$frac{delta}{E(X)}$$ arrivals.

I conjecture that what going “well into the lifetime” is doing is ensuring that the conditional distribution of the time from the start of your observation window to the first event seen after it is uniform over $$(0,t)$$ conditional on $$t$$ being the inter-arrival time for the interval within which the start of our observation window landed. I’m looking for a proof of this conjecture or a counter-example to show it isn’t true.

Why I’m making this conjecture

Consider a deterministic point process (with time between arrivals deterministic, $$t$$). This is a kind of renewal process. For this special case, Blackwell’s theorem can be proved as case-2 in the question here: General point process – expected number of arrivals within an interval.

Further, it’s shown here: For what distributions, \$X\$ is \$E(lfloor c-X rfloor) = c-1\$? that the proof only works when the time from the start of the window to the next event is uniform over $$(0,t)$$.

If this condition of uniformity is required for the deterministic point process, it must be required in general as well.

## mysql – what this error means

mysql> create table cats (
-> varchar(50),
-> age int,
-> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syn
tax to use near ‘varchar(50),
age int,
)’ at line 2

## dnd 5e – Does a turned creature have to move away from the caster even if it means it will take damage?

If, suppose, a fiend is on the edge of a cliff and an Oath of the Watchers paladin casts Abjure the Extraplanar on it. Would it have to jump of it? Or would it take the Dodge action since it cant keep “walking” away from the paladin.

The cliff example is a little extreme. But you could also suppose that the fiend is on a jagged mountain and the floor is considered difficult terrain such that a creature walking over it takes damage. Would the fiend placed in this situation walk over the difficult terrain to take the most efficient path to get away from the paladin, or would it try to sidestep the danger?

## Could someone please explain what this statement means?

It is from an article talking about Russell’s Paradox and why it was so significant.

"The reason this conclusion was so groundbreaking was because it showed that “one cannot both hold that there is meaningful totality of all sets and also allow an unfettered (unrestricted) comprehension principle to construct sets that must then belong to that totality.”

The conclusion was Russell’s Paradox

## Open WiFi Network Where All Confidential Communication is Encrypted Through Other Means

Imagine the following scenario:

• Users connect to an open WiFi network (no password, no encryption)
• All users stick to secure transmission protocols for all confidential data (HTTPS, SSH, VPN, etc.)
• Users devices do not accept any inbound connections

Would this scenario provide a reasonable level of security for the users involved? Or perhaps more importantly, does a malicious user’s presence on an unencrypted WiFi network pose a known threat to the other users?

## boot – Does a working nomodeset means the gpu isn’t defective?

I have an M6600 which runs Kubuntu 20.04. I have problems with the screen sometimes. The laptop boots and I am able to log in. After some while I get a brownish display with vertical stripes. Sometimes it doesn’t show the login screen.

What always works is setting `nomodeset` in grub. Does this mean my problem is software related? I want to check first before I buy a gpu (even the M6600 gpus are quite expensive right now).

Here is some more information about the M6600:

``````System:
Host: Precision-M6600 Kernel: 5.8.0-48-generic x86_64
bits: 64 Desktop: KDE Plasma 5
Distro: Ubuntu 20.10 (Groovy Gorilla)
Machine:
Type: Laptop System: Dell product: Precision M6600 v: 01
serial: <superuser/root required>
Mobo: Dell model: 04YY4M v: A00
serial: <superuser/root required> BIOS: Dell v: A04
date: 07/11/2011
Battery:
ID-1: BAT0 charge: 86.9 Wh condition: 86.9/98.2 Wh (88%)
CPU:
Info: Dual Core Intel Core i5-2520M (MT MCP) speed: 2394 MHz
min/max: 800/3200 MHz
Graphics:
Device-1: AMD Blackcomb (Radeon HD 6970M/6990M) driver: N/A
Device-2: Ricoh type: USB driver: uvcvideo
Display: x11 server: X.org 1.20.9 driver: vesa FAILED: ati
unloaded: fbdev,modesetting,radeon
Message: No advanced graphics data found on this system.
Network:
Device-1: Intel 82579LM Gigabit Network driver: e1000e
Device-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi
Drives:
Local Storage: total: 592.27 GiB used: 29.86 GiB (5.0%)
Info:
Processes: 204 Uptime: 22m Memory: 7.73 GiB
used: 1.48 GiB (19.1%) Shell: Bash inxi: 3.1.07

``````

## What means if [ "x/usr/bin" != "x" ] in bash script?

I’m trying to understand some sequence of bash scripts, and on one of the steps there is a condition:

``````if [ "x/usr/bin" != "x" ]; then <do some actions>
``````

What do mean:

• "x" in "x/usr/bin"
• "x" in the right hand side of the testing equation?
Thank you