design – Why does the C++ standard still allow uninitialized primitive variables?

(…) so that objects of primitive type (int, unsigned, float, double, bool, char) get default-initialized to 0? Wouldn’t this prevent an entire class of typical beginner mistakes?

I don’t think so. Usually the actual mistake is that the programmer either assumed the variable would be initialized to something useful after the declaration, or simply forgot to init it right there.

In many cases forcing zero initialization would only mask the problem. 0 is a valid value for all of the fundamental types but that doesn’t imply it’s useful and semantically valid for the use case in question. Consider:

/* Just for demonstration! This is BAD code! */

int result;  // uninitialized

// The function is supposed to initialize `result` to >=1 using an out parameter.
// But it’s buggy and doesn’t touch `result` at all.
fill_result(result);

// `result` is read here in some way.

Currently reading result at the end is undefined behaviour. Forced zero init wouldn’t improve the situation because the variable still does not contain a semantically valid value. It’s expected to hold a value greater than 0, after all. The error is just masked and likely to lead to problems later in the execution of the program. That’s very similar to undefined behaviour.

I can’t speak for the C++ committee, of course. And I cannot look into the mind of the C++ community as a whole. But I guess this is at least one important part of the reason why forced zero init isn’t considered as a change to the language – “you don’t pay for what you don’t use” being another important part.

Imo a better, although ultimately just as hopeless, idea would be to disallow uninitialized variables altogether. That would solve the problem, but would also be a backwards incompatible change to a commonly used feature. A proposal that’s guaranteed to break a vast amount of existing code is highly unlikely to make it into the standard.

What’s left is static and dynamic code analysis to detect such bugs.

networking – VLAN to non-VLAN and the standard

Seems like the 801.2Q standard text is not available for free, hence my question here, but not only because of that.

I am trying to figure out what should happen if an interface, configured with VLAN receives a frame without VLAN (untagged)? Should the receiving host drop (ignore) the frame all together or should it tag the frame and pass it through the networking stack?

And the other way around if the VLAN-enabled interface receives VLAN-tagged frame, should it only ignore the VLAN ID, but accept the frame or should it ignore the frame?

I could of course run an experiment on my Linux machine(-s), but I want to know if the VLAN technology standardizes such corner cases or if it is implementation specific.

database – What is the standard method for updating client views of data?

I’m working with a client who currently uses a database system that they’ve outgrown, so we’re re-building it using a different platform that can handle their growth. One feature of their current system, built into the platform, is that updates to data are automatically propagated to others viewing the data in real time. So if multiple users see a particular record on their screen and one of them updates that record, everyone viewing the record will see the updated data immediately. There is record locking, so only one user can be editing the record at a time.

This feature is important to the client. Currently the most likely replacement for their current system is a web-based client accessing a back-end database. Obviously this auto-update feature isn’t built into such systems, so we need to recreate it. But we’re unsure of the best way to do so. I’ve thought of a few possibilities, such as each client tracking which records they’re viewing and periodically polling the server to see if those records have changed, or having the server do this tracking, and send a message to the clients if one of the records they are viewing changes.

But I’m pretty sure this is a solved problem. So is there a standard method in software engineering to deal with this?

unity – How to create a standard pbr material with shader graph?

I want to create a standard pbr material that is editable with the shader graph, but when I install the package and go the Create -> Shader tab, I only have 2 graph options: Empty Shader Graph, and Sub Graph. Isn’t there a shader graph that starts me off with a basic pbr material with color and reflections? I’m using unity 2020, and the default render pipeline. Do I need to switch to ldrp or hdrp?

documentation – Compare the 830-1984 , 830-1993, 830-1998 to the IEEE Standard in terms of structure, contents, and style. Please Explain it briefly

Compare the 830-1984 , 830-1993, 830-1998 to the IEEE Standard in terms of structure, contents, and style. Please Explain it briefly.
Access and Read the IEEE Std 830-1993, using internet, try to find at least two other templates for requirements specification . Compare the templates to the IEEE Standard in terms of structure, contents, and style.

audit – What alternative standard for ISO 27001 can be used in Australia?

I am looking for alternatives, that are less strict and less time consuming, than ISO 27001. Australia is in the Commonwealth, so maybe Cyber Essentials Plus could work, but I do not know if that plays a part in it being recognized by the Australian Government. Any suggestions? Thanks!

EM algorithm – What happens with the standard deviation?

What have you tried?

So I watched this video.
According to the video, we’ve to calculate the variance $sigma^2$ as follows:
$$
sigma_{k}^{2} =
frac
{
p_{1} left(x_{1} – mu_{k_1}right)^{2} + ldots + p_{n} left(x_{n}
– mu_{k_n}right)^{2}
}
{
p_{1} + p_{2} + ldots + p_{n}
}
$$

Where

  • $k$ is the index of the current guassian class.
  • $p$ represents the possibility of one point of the set
  • $n$ is the amount of points in the set

So what’s your question?

I don’t understand, why we have to use $mu_{1}$, $mu_{2}$, $ldots$,
$mu_{n}$. I expected to calculate it follows:
$$
sigma_{k}^{2} =
frac
{
p_{1} left(x_{1} – mu_kright)^{2} + ldots + p_{n} left(x_{n}
– mu_kright)^{2}
}
{
p_{1} + p_{2} + ldots + p_{n}
}
$$

Because why do I have to use the "current-calculated" mean of the guassian and
not the "final" one?

generating random pair key has standard?

If a crypto wallet generates all pair key between small range for example between 1-100, the risk and possibility of creating the same key is an increase. Generating random pair keys for cryptocurrency has standard? If the answer is No what the solution cryptocurrency for it?

Standard Error in Nonliner Model Fit

What does the Standard Error in Non Linear Model Fit signify ? How is it calculated ? How can I interpret the value in terms of goodness of my fit ?