« first day (182 days earlier)      last day (2671 days later) » 

5:54 AM
@Aaron okay I was wrong
apparently there's no shadow space on linux calling convention
@Aaron I've tried reading this assembly listing but some parts mistify me, for example that movl $0, -4(%rbp) and the part where we're loading the address of buff to %rax and then to %rdi just before the call to gets
 
7:01 AM
@milleniumbug no worries. i posted a question on this here stackoverflow.com/questions/41537314/…
although it hasn't been received too well :-/
i have yet to fully understand it myself. i need to step through it with gdb sometime this week
good to know that there's no shadow space on linux. guess it really is just a MS thing
 
7:51 AM
@Aaron that's your usual overzealousness on SO, don't worry about it
these people seem to expect that if a question is tagged with , then it's a C question. Well, no, it's not a C question, see the other tags.
okay -4(%rbp) is where auth is stored
 
8:23 AM
RBP-0    PADDauth
RBP-8    ????????
RBP-16   ????????
RBP-24   -------P
RBP-32   buff----
RBP-40   PADDargc
RBP-48   argv----
@Aaron the main question is what is this space marked by question marks used for or if it's a paddding (and it probably is), why is it required
 
 
10 hours later…
6:27 PM
Hello, I have a bigger question.
I need to gather a lot of data from different pc's and store them into a database. These data should then be analzyed in realtime while still reading the new data in.
The PC's are all connected to the server and store the results in textfiles.
I researched a little bit and i could use a sql database.
What do you think is the best approach to gather data from different sources and analyze them in real time. maybe on a web interface
so that everybody could just go on that site look at it and see some easy tables to confirm if the machines work correctly
 
nwp
That depends a lot on the data and the analysis required.
Are we talking MB, GB, TB or PB?
 
MB
the machines test continuously but the amount of data delivered per day doesnt exceed 1 gb
 
nwp
Then you don't need a database.
 
What approach would you recommend? The goal would be to have access to the data on a internal webinterface.
 
nwp
Maybe you could just get the data via sockets and put it in some vector or map.
 
6:35 PM
could you give me a reference to "via sockets"
 
nwp
Web servers usually have a way to do CGI to get the data onto the web interface.
@Schbabako Sockets. Not sure what the best way to use them is, but boost::asio::ip::tcp::socket is probably decent.
 
Yes thank you. I am doing some research. This is going to be project for itself.
 
@nwp ZB. Per second. :-)
 
user406009
@Schbabako There are two general approaches to this. One is to use HTTP POST requests and do things that way. The other is to use TCP sockets to send the data (see boost asio).
 
@nwp so it is possible to create data sockets on each pc that is connected to a tester and make the data that is given by the testers accessible over our servers to my pc
 
user406009
6:42 PM
You would want to store the data locally using an sql database, for 1 GB per day, I would recommend sql lite.
 
user406009
(At least to start with)
 
ok i understand. I will start doing my researches. Thank you for your suggestions.
THanks @Lalaland and @nwp
 
user406009
@Schbabako If you are talking about 1 GB per day, I would ditch C++.
 
user406009
I would use Python with Flask and do the HTTP approach.
 
i have to do some "worst case" calculations to calculate the maximum amount of data that is stored
 
7:11 PM
more of a general programming question rather than specific to c++, but I'm having a hard time implementing this in c++... Basically, I have a background process that I want to run constantly, but not use up a lot of cpu. What's the best way of calculating the amount of time a program needs to idle periodically?
so as to spread the work out evenly over a period of time, rather than run a given loop as fast as possible. but also have it dynamic in the sense that it would be relatively similar on other platforms
 
user406009
Your OS will actually make sure no process uses too much of the CPU at any given time.
 
user406009
A better approach would be to set the priority of your process and let the OS deal with it: linux.die.net/man/2/setpriority
 
user406009
(That's the linux version, but you can find similar for other purposes)
 
nwp
@Dave You are not supposed to have these kinds of loops. Or be happy that so much work gets done so quickly. If it uses up CPU without doing actual work you can replace it with something better.
 
user406009
I might have misunderstood what you mean by periodically though, if you are talking about new work coming gradually in, you can usually just sleep an hour at a time or some such.
 
user406009
7:16 PM
We could probably provide more concrete advice if you can tell us why you want the work spread out over time.
 
user406009
(Worried about overloading, new data coming in, etc)
 
it's both a problem of new work coming in and spreading out the work evenly.
so, I have an arduino that's collecting various data from the environment. it collects a lot at once and every so often sends all of the raw data to a server, which then my background process would pull and do various number crunching things etc
but as a toy example,
say I wanted to multiply two floating point numbers 1,000,000,000 times and then write the results to a file
 
user406009
Yeah, I wouldn't worry about the CPU usage. Just set the CPU priority super low.
 
user406009
There should be a way to do that for every OS.
 
if I run that code, my cpu maxes out for a while, and then comes back down when it's finished
 
user406009
7:20 PM
You can just wait for 10 minutes or an hour or so for your other purposes (although, like I stated before, just waiting for new data to come in is usually a better option)
 
so is it more pointless to try and estimate how much work the cpu will do to make it platform independent and just adjust the wait time between iterations?
to make it idle more and spread the work out
 
user406009
I would only try to do that if setting the lowest priority wasn't working for your OS.
 
@Lalaland right
I would rather just now have to set to low priority and have it dealt with programmatically.
not*
 
user406009
You can programmatically set it to low priority.
 
im sorry I just read the link you sent me
yeah works for me. thanks
haha it's funny, I was so bent on doing it my way I never considered something so simple as setting os priority
 
user406009
7:30 PM
Do let us know if the OS priority thing doesn't work for you.
 
user406009
(These systems aren't foolproof)
 
user406009
Then we can consider more complicated approaches where the program tries to limit itself or some such.
 
thats what I was doig initially
doing*, but this might do the trick. Ill report back in a few seconds
hmm, no it's not exactly what I'm looking for
but instead of trying to poll what the actual cpu % might be, I'm just going to extend the sleep time between iterations
 

« first day (182 days earlier)      last day (2671 days later) »