C/C++ :: Program That Monitors Downstream Speed Realtime

Feb 14, 2015

I want to create a program in windows, it will search for a process/program by name or part of its name and monitor real-time at certain intervals the data speed at each moment that are received from the internet by this process/program. So that when no data is received by the process/program the speed will be zero and i will know it.

Can i do it in c or c++ , if yes then what libraries should i look into to do it and if i can not with these then what language and libraries should i look into to create the program?

View 1 Replies


ADVERTISEMENT

C# :: Reading Standard Output From Console Application In Realtime?

Jul 12, 2014

I'm having some trouble working out how to read the console output in realtime, here's my code:

The button which starts the console application:

private void HELPRUN_Click(object sender, EventArgs e)
{
this.Output.Text = "";

[Code]....

View 6 Replies View Related

Visual C++ :: Can't Make Double-buffered Painting With Multiple Monitors

Sep 19, 2012

I'm trying to remake my Windows screensaver written with C++ and WinAPIs to work on multiple monitors. I found this article that gives the basics. But when I implement it in my own code, I get a weird result. Take a look at this code:

Code:
case WM_PAINT: {
PAINTSTRUCT ps = {0};
HDC hdcE = BeginPaint(hWnd, &ps );
EnumDisplayMonitors(hdcE, NULL, MyPaintEnumProc, 0);
EndPaint(hWnd, &ps);

[code]....

Painting always works on a primary monitor. But when I paint to the secondary monitor, I can only paint directly to its DC. When I use double-buffering technique (with DIRECT_PAINT pre-processor directive commented out) I only get a black screen on a secondary monitor when it should've been red.

First one with direct painting that works:

and then the one that doesn't, with double-buffering technique:

View 12 Replies View Related

C++ :: Encapsulating Speed Types Of Different Animals

Nov 22, 2014

#include <iostream>
#define show(variable) std::cout << #variable << " = " << variable << std::endl;
class LivingBeing {
protected:
struct Speed {

[Code] ....

Though the above works, memory is being wasted for speed types that do not pertain to many animals (a snail only crawls, a human never flies, etc...). Saving and loading their files will involve a lot of useless zeros. The problem seems simple, but I can't think of a good redesign to encapsulate speed properly for each of the many, many types of animals. Note that main() works with speed from the base class LivingBeing.

Should there be polymorphic Speed types within each Animal subtype? Then there will be a lot of identical Speed subtypes (e.g. many animals can only swim).

Something like:

class AnimalsThatOnlySwimOrCrawl : LivingBeing {
protected:
struct Speed : LivingBeing::Speed {
int swimmingSpeed, crawlingSpeed;
virtual void increase() override {swimmingSpeed *= 2; crawlingSpeed *= 2;}

[Code] .....

View 10 Replies View Related

C++ :: How To Convert Velocity Vector To Speed

Feb 16, 2012

Any example code to convert a velocity vector to speed in C++?

View 2 Replies View Related

C++ :: Runtime Speed Integer Versus Double

May 27, 2013

Using integers faster than using floating points? Or more precise: what do you estimate as the chance that writing a custom floating point class is worth the effort?

I need to examine some C++ code for an ARM7 or ARM9 processor. Instead of using floating points, the coder had chosen to use integers only. To be able to fake floating points, a custom class was written. The coder states that he avoids using floating points as these are much how much slower. "Have you measured this?", I asked. "No, but it is known to be so", he replied.

Google taught me that most people state integers are faster than using doubles, because their operations (addition, multiplication) take less assembler instructions. But if you need those floating points, what do you estimate as the chance that writing a custom floating point class is worth the effort?

View 2 Replies View Related

C++ :: QLabels And High Speed Updating Causes Crash

Jun 26, 2014

On a project I'm working on, I need to update many QLabels very quickly. Each label needs to be updated at about 20 to 50 hertz and there can be over 50 labels at any given time. The problem I'm having is after running the program for about a minute, the labels freeze and the whole program crashes about 10 seconds later. If I comment out the setText() and setNum() calls and reroute the outputs to the console, it runs fine and never crashes. Why does calling SetText() and setNum() so quickly cause the program to crash and how can I prevent this?

View 5 Replies View Related

C++ :: Processing Speed Of Rectangle Intersect Function?

Feb 20, 2014

I'm trying to find the fastest method to find whether or not two rectangles intersect in an effort to streamline my code. I've built this function into a rectangle class I created below.

struct rectangle{
rectangle() :X1(0), Y1(0), X2(0), Y2(0) {};
rectangle(int X1, int Y1, int X2, int Y2)
:X1(X1), Y1(Y1), X2(X2), Y2(Y2) {};

[Code].....

View 3 Replies View Related

C++ :: Speed Of Floating Point Multiplication / Division

Jun 2, 2012

I heard that the speed of floating point multiplication is much faster than division. Is it still the case today?

View 14 Replies View Related

C++ :: How To Control Speed At Which A Loop Loops Based On Outside Variable

Feb 20, 2015

I'm using an animation program. In this program I've simulated a particle system. The particles are flying around at different and varying speeds. I've attached birds to the particles and I want to be able to control each bird's flapping animation based on its velocity; so birds moving faster will be flapping faster.

Initially, the bird's flapping animation is controlled by a parameter that goes from 0 to 100%. So not only do I need to drive the speed at which the animation goes from 0 to 100%, I need to set it on a loop so once it reaches 100%, it loops back to 0%. I'm extremely new to code so I don't think it would be wise for me to even provide a jumping off point, not that I could.

View 8 Replies View Related

C++ :: Recursive Directory Scan - Can Use Multi-threading For Speed?

May 11, 2014

In our Qt application, we have to load several files on application start-up starting from a root directory.

We are recursively scanning the directories and loading the files.

The total time it takes is about 12 seconds. Can we reduce this time if we use multi-threading?

I have heard that multi-threading does not work everywhere and it increases code complexity and debugging issues.

Would multi-threading solve the above problem? We want it to be platform independent (Mac, Linux, Windows).

View 9 Replies View Related

C++ :: Program With Do-while Loop To Restart Program And Validation

May 11, 2013

I am having problems at the end of the program with the do-while loop to restart the program and the validation.

#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
#include <time.h>
using namespace std;

[code]....

View 3 Replies View Related

C/C++ :: Program Which Removes Notes From Program File

Mar 10, 2014

so my homework assignment is to make a program of which removes any notes in a program file.

for example, you run my program it will ask for a filename, when entered it opens the file, copies everything in it and removes any double forward slashes (//) and anything after that up to the new line character ( ) and anything between /* and */ including the /* and */.

i created the entire program and it removed the // and anything after that up to the new line character but will not remove anything after the first / when it finds a /*. This includes the */ at the end of the comment.

the section of code that removes the comments is

//this loop removes all notes
for(i=0;i<buf.st_size;i++) {
if((filecontent[i]=='/')&&(filecontent[i+1]=='/'))//removes notes using //
{
for(i=i;filecontent[i]!='
';i++)
filecontent[i]=' ';}

[Code]....

i know that the section that removes the multi line comments would not remove the final */ at the end if it did work, i was planning to fix that later once it removed the comment.

View 6 Replies View Related

C++ :: Transform Program To Program Using Class

May 15, 2014

I have my program to load info about students from .txt file

Mrkvicka Jozef 2 1.75 2.1 0.4 1 0.49 1.27
Hrasko Jan 0.1 0.38 1 1.2
Mladek Peter 1.6 0.4 2 1.3 1.8
Petrzlen Robert 0.6 0 1.1 1.1 0.6 0.59
Horvath Ivan 1.6 0.8 0.7 1.3 1

My program is ruuning perfectly only problem is that i must transform it to program uses class, class student . Am very beginer in using classes, so far i do very easy programs using classes.

so far i have this

#include "stdafx.h"
#include "student.h"
student::student(vector<STUDENT> studenti) {
vStudent=studenti;

[Code] ....

I try to make it but its too difficult for me. in that student.h and student .cpp is 50 errors..

Here is my code

#include "stdafx.h"
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace std;

[Code] ....

View 13 Replies View Related

Visual C++ :: Program Run In Another Program

Jul 22, 2014

I want to make a program which can run in another program. My program have structures flowing:

while (1) {
check (keypressed);
{
do something;
}
}

But check(keypressed) function only active in my program, It can't run in another program.

View 7 Replies View Related

C++ :: SDL - Can't Run Program Outside Of IDE

Sep 4, 2013

I've been working on a small SDL program and decided I wanted to throw the program on to a disc so I could show some people what I'm working on. However, when I try to run the executable, the program crashes and under more details it says that the fault lies on SDL2_ttf.dll .

Why does this program work inside of VS2012e and not in windows?

What I did :

Set the program to release, hit f6, and then tried to run the executable from windows.

Additional information :

Compiler : Visual Studio 2012 express
O/S : Windows 7 64bit
SDL lib : 32 bit version

View 8 Replies View Related

C :: How To Get Program To Write Itself

Aug 27, 2013

For instance Code: int counter;
counter =0;
FILE *pfile;
pfile= fopen("g:myprog.txt" "w");
while (counter >100)
{ fprintf (case counter{something})}; how do I do this?

View 11 Replies View Related

C :: How To Get Average Of Program

Mar 20, 2013

Cannot divide the real output of the AVERAGE.:

Code:

#include<stdio.h>
#include<conio.h>
struct student
{
char Name[50];

[Code]....

View 7 Replies View Related

C :: How To Get Output Of Program

Dec 8, 2013

how to get the output of this program.. I'm not completely lost but I need it in the simplest terms.

Code:

/*Recursive Trace
Written by Ron
April 2006
*/

[Code]....

View 9 Replies View Related

C :: Have A Program Where It Ask For Three Numbers

Feb 1, 2013

is there anyway to have a program where it ask for three numbers and you shows which which number is the largest and which is the smallest, e.g.

Enter 1st number: 30
Enter 2nd number: 10
Enter 3rd number: 30
Largest = 30
Smallest = 10

View 12 Replies View Related

C :: Natural Log Program

Oct 16, 2014

I am working on a program to compute the natural log of numbers using several different methods, but I am having a couple of issues. Firstly, when using Borchardt's Algorithm I almost always end up with nan as a result, even though I am pretty sure I got the formula correct. Also, in my lnDemo.c file It doesnt give me the correct answer and the second time around I get a segmentation fault.

Code:

//myLog.h-------------------------------------------------------
//These functions will compute or aproximate the natural log of a number
//This method will use a formula to compute it
int lnFormula(double x, int m,double *result);

[code]....

View 7 Replies View Related

C :: Program Is Not Terminated

Feb 26, 2014

I have written the below code,

#include "stdio.h"
int main() {
int c;
while((c=getchar()) != EOF) {
putchar(c);
}
}

The above program is not terminated.how to terminate it?

View 3 Replies View Related

C# :: How To Add More Than One Database In A Program

Mar 5, 2014

Is it possible to add more than one database in a C# program if so, how?

View 7 Replies View Related

C :: Program That Runs On A PC But Not On Another

Mar 6, 2015

I'va create a c program that scans the web from a root it works on mypc but dont works on another pc of my friend.I have created this project with Visual Studio 2013 disabling extension to obtain standard ansi c project.

View 2 Replies View Related

C :: Age Identifier Program?

Jul 2, 2013

I have an issue with a switch case in my program. I execute it and it does fine all the way up to where it says, "Answer (1, 2, or 3): ". When I enter 1, 2, or 3, it gives me' "Not an input choice!" from the default of the switch case.

NOTE: I use Code::Blocks on Windows XP.

Here is the code:

Code:

#include <stdio.h>
#include <string.h>
int main() {

[Code].....

View 8 Replies View Related

C :: Using More Than One If Subroutine In One Program

Mar 20, 2014

Can we use more than one 'if' subroutine in one program. I am trying to implement this but if I run the two subroutines at the same time the lower subroutine directly shows "invalid grade". But if I run one at a time then they work perfectly fine.

Why is this happening? Does the compiler think that its the same "if" routine. If so how do I segregate it???

Code:
printf("Enter a score:");
scanf("%d",&gr);
if(gr>=80 && gr<=100)
printf("A Grade
");
if (gr>=60 && gr<80)
printf("B Grade

[Code] ....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved