146
votes
Accepted
Should temporary files be saved to /tmp or the current working directory?
Temporary files have to be stored into the operating system temporary directory for several reasons:
The operating system makes it very easy to create those files while ensuring that their names ...
138
votes
Accepted
Does storing plain text data take up less space than storing the equivalent message in binary?
Plaintext is binary.
When you write an H to a hard drive, the write head doesn't carve two vertical lines and a horizontal line into the platter, it magnetically encodes the bits 010010001 into the ...
105
votes
Accepted
Would having 4 states per "bit" rather than 2 mean twice the storage space?
The word you are looking for is not "bit" but "symbol." "Symbol" is the word used to describe the process of mapping hardware signals (such as voltages or magnetic patterns) into logical bits. If a ...
58
votes
Accepted
Professional way to produce a large problem without filling up huge arrays: C++, free memory from part of an array
What you describe, "smoothing by fives", is a finite impulse response (FIR) digital filter. Such filters are implemented with circular buffers. You keep only the last N values, you keep an index ...
55
votes
Modeling first and lastname separately
First name and last name are not useful concepts. Names work differently in different countries. In most Asian countries, the family name is written first, but it is still used for sorting—so you may ...
33
votes
Should temporary files be saved to /tmp or the current working directory?
Should I insist saving to /tmp is the right approach and defend for any failure as "working as intended" (ie. ask your admin for proper permission access)?
There are standards for this, and the best ...
32
votes
Modeling first and lastname separately
The only argument that matters is what are the requirements of your system?
Do you need to deal with just one culture? If so, conform to that culture. Otherwise plan for internationalization (as ...
24
votes
If C++ is generally faster than java, why most data analysis / ETL tools are developed in java?
Assuming for a moment that the general performance difference is true...
Java has more mature data manipulation libraries.
Java has mildly sane string manipulation.
Java has a wider userbase.
Java ...
21
votes
How should I store readonly data to deploy with my application?
If the data never changes and is read only, then just put it in a code file as a list of constants.
public readonly string AppStartUpData = "MyAppNeedsThis";
If this data is different per deployment,...
21
votes
Would having 4 states per "bit" rather than 2 mean twice the storage space?
One quarternary memory cell can store exactly as much information as 2 binary memory cells:
Quaternary Binary
0 00
1 01
2 10
3 11
So if you have same number of ...
19
votes
Accepted
How does Microdata rdfa compare to JSON-LD?
Microdata is not dead. While Microdata will not become a W3C standard¹, it’s still part of WHATWG’s HTML Living Standard.
Differences between JSON-LD, Microdata, and RDFa
(in the context of HTML ...
19
votes
Does storing plain text data take up less space than storing the equivalent message in binary?
I find this a great fun thing to think about. Binary is not 1s and 0s in the way you talk about it.
Imagine there is a quantity, I can tell you what quantity it is in many different ways:
Nine in ...
19
votes
Accepted
File storage microservice design
A goal of a service in SOA is to perform some logic which, otherwise, would have to be duplicated among other services. That logic is, in turn, the reason for the service to exist.
In your case, you ...
17
votes
Accepted
Microservices - sharing data through distributed in-memory cache?
Just like using a single database for multiple services, the approach you describe causes a strong coupling between the services. For example, you can not change the data model of one service without ...
15
votes
How should I store readonly data to deploy with my application?
You can always add a file into your project and set its build type to Embedded Resource so that it is embedded directly into the application itself.
Alternatively a file that is encrypted and placed ...
15
votes
If C++ is generally faster than java, why most data analysis / ETL tools are developed in java?
I think there's more to this than simply that the workflow for ETL is typically I/O bound, not CPU bound; that's just the justification.
The real issue here is development cost.
C++ applications of ...
15
votes
Accepted
Is there any use case for using 'L' letter after a number literal in C?
In the C language expressions are typed inside-out: literals have types. E.g. 123 is an int, and 123U is an unsigned int, 123L is a long int and so on. The type of an expression depends on the types ...
14
votes
Accepted
How should I store readonly data to deploy with my application?
A binary file would be the obvious answer, but it depends on how you are loading it - you might as well make life easy for yourself if you can.
XML might be a good choice as there are built in ...
14
votes
Does storing plain text data take up less space than storing the equivalent message in binary?
Does storing plain text data take up less space than storing the equivalent message in binary?
No, never.
Your computer already stores the plain text data in the equivalent binary representation. ...
13
votes
Accepted
How to deal with constructors in large data classes
You are looking for the builder pattern.
Essentially it's an object with setters where you can set the parameters for construction and a createResult() method that will create the object you are ...
13
votes
Accepted
"Reactive programming is programming with asynchronous data streams." is this true?
The most common example of Reactive programming that I've heard about is a spreadsheet program that has computed values.
Personally, I would think about a spreadsheet more as a hybrid between ...
13
votes
Professional way to produce a large problem without filling up huge arrays: C++, free memory from part of an array
Every problem can be solved by adding an additional level of indirection. So do that.
You can't delete part of an array in C++. But you can create a new array holding just the data you want to keep, ...
12
votes
Accepted
Binary data formats, how to make ensure you can read different format versions?
It seems to me that the simplest solution is to make your version header unambiguous and make sure that the old format can never look like it has a format header, you simply look for it. If it's not ...
12
votes
Which layer should have responsibility for rounding numbers?
Monetary values in general do not use floating point (always approximation errors!), but fixed point, as BigDecimal in java, DECIMAL in SQL. For currencies you then have a defined precision (2 ...
11
votes
Accepted
How to test data based on SQL queries?
Been there, done that.
First let's make something clear:
That's not unit testing. Unit testing is about code. You are not runnning the tests after a code change to test if code alterations ...
11
votes
Accepted
Why is it considered a good practice to isolate data management in a microservice?
A big advantage that a Microservices architecture has is that each service can be safely developed, tested and deployed independently. Having services share a database undermines this as it allows ...
11
votes
Is it anti-pattern to have inheritence in a dto?
Update: Rewrote code in Java since this question is tagged java but this applies to any object oriented language.
If using inheritance is a means of reducing code duplication, I'm a little reluctant ...
11
votes
Why do or should programmers save data in text based formats like JSON or XML instead of binary?
JSON and XML are less efficient than pure binary, but what you aren't considering is that they (JSON/XML, and some other formats like YAML) are standardised, while binary isn't - different systems, ...
11
votes
Prevent analytics from crashing the production database
I will start with the simplest solution, per amon's comment - create a read replica - if you are hosting your database in a cloud provider, this is typically just a few clicks or a few changes to your ...
10
votes
Should temporary files be saved to /tmp or the current working directory?
The previous answers, although correct, aren't valid for most large scale computer clusters.
Computer clusters not always follow the standard conventions for machines, usually for good reasons, and ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
data × 450database × 66
data-structures × 42
design × 41
java × 26
database-design × 25
storage × 24
design-patterns × 23
architecture × 23
algorithms × 23
c# × 16
c++ × 16
relational-database × 12
validation × 12
object-oriented × 11
testing × 11
python × 10
terminology × 10
security × 9
microservices × 9
json × 9
c × 8
web-applications × 8
memory × 8
binary × 8