|
Hi,
Well Ideally, sets of binary data of my own design, but, essentially a set of databases relating to a number of different customers, who will hold their archives and trading records there, There will also be a number of PDF's and jpeg's, facsimiles of identification documents to comply with local money laundering legislation.
Regards,
Bram.
Bram van Kampen
|
|
|
|
|
What happens if the internet connection goes down ... business stops? Nobody gets their clothes back? I'd use "the cloud" for backup, not as a primary.
Same application ... just sync to the cloud periodically.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Gerry Schmitz wrote: What happens if the internet connection goes down ... business stops? Nobody gets their clothes back? I'd use "the cloud" for backup, not as a primary.
Well, the same ass what happens currently when the electricity goes down, or a disk fails. These things have happened. We close the shop, and indeed on those rare occasions, people get their clothes back via a manual system, but, payment is not asked for. Actually Handing in far processing is far more challenging. We would require an automatic sync at least 10 times per hour.
Bram van Kampen
|
|
|
|
|
You need to find which cloud storage you want to use (google, amazon...)
Then look at the API/SDK they offer.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Well, is there a list of smaller providers? or Intermediaries?
Bram.
Bram van Kampen
|
|
|
|
|
Is there any way I can configure Visual Studio 2019 so that when I build the solution, it automatically builds a 32 bit and a 64 bit version of the same native project at once?
It's a pain to have to keep two different projects in sync to build two different executables.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Only if you share resources with Richard Andrew x32
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
|
You could always have VS build the x86 version and create a PostBuild event bat file and run the MSBuild command line to build the x64 version.
|
|
|
|
|
|
Thank you Victor!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I spend most of my development time using 64 bit Debug, but have to build both 32/64 and Debug/Release and test before I check in. I call MSBuild from a batch file to build everything. My dev environment is highly customized, and have a post build deployment script that runs and updates all 4 installations automagically to 4 different VMs that I have our products running on. At the end of each build, it triggers automated testing on each of those VMs.
|
|
|
|
|
#include<iostream>
using namespace std;
class calculate
{
private:
int x,y;
public:
void input (int p, int q);
{
x=p;
y=q;
}
void output()
{
cout<<"In sum=" <<(x+y);
cout<<"In product" <<(x*y);
}
};
main()
{
calculate m;
m.input(60,40);
m.output();
}
|
|
|
|
|
And what???
|
|
|
|
|
Look at the line that gives the error message, or the one before it:
void input (int p, int q); {
|
|
|
|
|
Message Closed
modified 18-May-21 9:50am.
|
|
|
|
|
You could create two projects in the solution, one windows and one raspberry. Add the same source code to both projects and you should be able to build both together.
|
|
|
|
|
Judging by the link at the end of the message, he's a spammer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Maybe there is a setting for this or a utility or what not. I've been tracking down a buffer overrun and loss of data for a few days, and I have discovered that a data structure pretty clearly defined is blowing past it's size. I think it's due to silly datatype selection and not understanding padding.
I'm working in VS2008 (no choice), and I've yet to find something to help me understand the exact byte layout of a structure. I really need to see the padding being added. The fact that I have a mix of unsigned ints, bools and bytebools can be attributed to ignorance and just poor programming.
This seems to me something any IDE should be able to show me, but if you recall, Microsoft just broke help in VS2008. I was thinking the map file, but I'm not seeing it. What I would like to be able to do is to add a watch to the data structure. In the watch window, I want to see the addresses of each item in the structure by expanding it. But I think I'm going to have to do a lot of typing.
Appreciate any pointers.
Long weekend ahead.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I'm not sure why you'd be having data overruns, assuming you're sizing any I/O or copying correctly. Even if you have an "anonymous" buffer (e.g. char *), that you're copying your struct from, things should still work correctly with the appropriate sizeof operator in use.
I don't know of any tool within VS that will give you the information you need, but you might get some mileage out of [pack pragma | Microsoft Docs](https://docs.microsoft.com/en-us/cpp/preprocessor/pack?view=msvc-160), and or [offsetof Macro | Microsoft Docs](https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/offsetof-macro?view=msvc-160). Either or both won't save you from some typing though.
I think you need to be careful with #pragma pack. X86-64 doesn't seem to have a problem accessing unaligned data, but I assume its slower to do so than correctly aligned data. Other architectures though are not as accommodating. For example, the following code works fine on X86-64 in both 64 bit and 32 bit modes (at least using linux), but gets a bus error when running under arm-32
#include <stdio.h>
#include <stdlib.h>
int main()
{
void *ptr = malloc(1024);
char *tmp = ptr;
for(size_t i = 0; i < 24; i++, ++tmp) {
long double *d = (long double *)tmp;
*d = i * 2.0L;
printf("tmp = %p, d = %p *d = %Lf\n", tmp, d, *d);
}
free(ptr);
return 0;
}
Keep Calm and Carry On
|
|
|
|
|
k5054 wrote: I think you need to be careful with #pragma pack. X86-64 doesn't seem to have a problem accessing unaligned data, but I assume its slower to do so than correctly aligned data. A bit, on average, but not due to mere misalignment itself. There is a small penalty for crossing cache line boundaries and a different one (~85 cycles on Haswell, even more on Core2, not so much on AMD processors or Skylake and newer) for crossing 4K boundaries. That makes random unaligned loads and stores a bit slower on average, since some of them will cross those boundaries, but it doesn't make all of them slower and the impact is averaged out. Usually the addresses wouldn't really be random of course, so you could run into some situation where it keeps hitting a bad case, which would amplify the problem.
There are various other caveats..
Of course, avoiding unaligned operations avoids the whole issue.
|
|
|
|
|
Sorry, I got too specific in my comments and did not provide enough detail. The structure in question is unioned with a communications buffer. The code assumes the structure will fit in the buffer, but there are no checks. It just so happens that the structure extends beyond the communications buffer (from the alignment issue I think - hence my question.
In any event, the result is that the structure's data is truncated with values lost at the end. Luckily, the last 200 bytes or so are spare, so no harm or foul but lousy coding all the same.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
If you have a fast data source, eg. a file or RAM, from which you know that the data element will always be available in a single operation, you should probably read the struct directly e.g.
struct S {
int i;
double d;
char str[25];
};
S s;
std:ifstream data("data.bin", std::ios:binary);
data.read(reinterpret_cast<char *>(&s), sizeof s); If you have a slow data source, from which multiple reads may be needed to read a single data item, you should probably read and update a buffer and then copy that to the struct when you have enough bytes.
Using a union for type punning is not really the best solution. There's a good explanation of that on Stack Overflow: c++ - Accessing inactive union member and undefined behavior? - Stack Overflow[^]
Keep Calm and Carry On
|
|
|
|
|
k,
see my other comments. it's not an overrun in the traditional sense. Just two unioned structures that are assumed to be size compatible, so the aligned structure extends past the other. sorry for the confusion.
thanks
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
A union of structs will take as much space as is required by the largest member of the union. So the mere fact that it is a union should not cause problems.
|
|
|
|