It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I've just recently begun programming in C. I currently have an application that read's in values from a COM port and write them to a file. It reads about 500 data points per second. I want to be able to compute a real-time 2D plot of the data points with respect to time. Can someone please point me in the right direction?
I've tried to post-process the data in Excel and the built in capabilities allow me to get a great graph. However, I would just like something that is computed in real-time rather than post processing it. I am using Windows XP.
Thanks in advance !
You can use KST to plot your graphs in real time. You can probably keep your existing application as is (I assume you are writing to a CSV file if you are reading it in Excel) as KST will read the data from the file as it gets updated, and update its chart.
Here are some options for you to explore:
You can use OpenGL and in particular, GLUt. I have some C code for
this if you are interested.
You can pipe commands to gnuplot.
You can use GNU Octave from a C/C++ program. You can read more about
this here.
You can create your own bitmaps in real-time of you graphs. This isn't as hard as it sounds.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to implement PLC like HW that would be able to be programmed with some universal programming language (can be ANSI C for a start).
I'd like to program HW in several steps :
write generic program in txt file (can be subset of ANSI C for a
start)
parse that txt file and build some sort of execution graph to
be sent to ansi c engine on embedded HW
have ansi c engine that can execute "execution graph" over and over...
I've found pretty similar and interesting project here:
http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/DDJ/1989/8908/8908d/8908d.htm
but this is interpreter and parses program as a text for each step and is getting pretty slow and not space friendly. What I would like to change in this story is to parse C program in execution structure (AST?) once and then just execute it with ansi c engine on embedded HW.
I'm pretty sure that something similar is already done and shared. Please help me with starting points, advice or any other opinion...
Thanks in advance,
regards,
Bulek.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have begun writing (in C) a small client/server application which relies on TCP. I lack any experience in network programming. I'm sorry for the open-ended character of this post.
I'm wondering how best to encode and decode messages. I've chosen the following approach:
The client sends commands to the server. Every command has a number assigned to it and a struct. The struct stores the command's arguments and the way the arguments are laid out in memory (and in the stream as well). When the client wants to send a command, it fills the respective struct with data. In order for the server to recognize the command, the client sends one byte which contains the command number. Right after the command number byte, the message itself is fed to the stream (with its fields properly converted to network byte order).
This approach led to working code, but it entails a lot of redundancy (I find myself writing switch statements over and over). Is there a better way? What's the standard procedure?
Google's Protocol Buffers are a nice way to serialize/deserialize data. There are implementations for C.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am currently working on a face detection program using haar classifiers(I am using the sample program that comes with opencv installation).What i need to do is to extract this code out of opencv and make the code work without opencv libraries i.e. without opencv installed on both windows and linux desktops.I have been trying to do this for a while but with no success.Any suggestions on how to do this?
Thanks in advance
OpenCV is a very sophisticated imaging library. The sample program will use the library(!), you cannot simply run the code without the library.
You won't get any performance benefits running "copy-pasted" OpenCV code on BeagleBoard's DSP.
C64x is a fixed point DSP, floating point support is done in software. So you will need to convert OpenCV code to fixed point, to use full power of DSP
Main bottleneck of cvHaarDetectObjects() is not calculations, but uncached memory access during feature calculation, so you won't get any benefits in running it on DSP as-is.
What you can try is to port functions like cvIntegral() - they might be accelerated on DSP.
Check this:
http://elinux.org/BeagleBoard/GSoC/2010_Projects/OpenCV
http://code.google.com/p/opencv-dsp-acceleration/
http://www.computer-vision-software.com/blog/2009/04/fixing-opencv/
http://pramodpoudel.blogspot.com/
And this - running Viola-Jones on ARM7
http://cmucam.org/wiki/viola-jones (especially CC3 Face Detector document)
http://cmucam.org/browser/trunk/projects/viola-jones
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
can anybody help? How to load big files (2-5 MB) into SynEdit/UniSynEdit and do not let application get stuck, to make fast work? Is there virtual mode?
Thanks!!!
If resizing is slow, the problem is not loading, but rendering. Text is already in memory, but the component has to compute each line beginning on screen. If this part of the editor is not optimized, it could be slow (especially if it does allocate a lot of small strings for each line or word on screen).
The bottleneck of this component is when you use text word wrapping: the TSynWordWrapPlugin.DoWrapLine method '(doing all the work) do rely on the highlighter and will tokenize all text. I suspect that with a profiler, you'll see that most time is spent here. But I don't see any other way of handling it, without a major code modification. There is no so called "virtual mode" in SynEdit: it loads all and renders all lines in memory.
You could try the Letterpress version, which claims to be faster than original SynEdit. But it uses the same wrapping logic, so I guess there won't be a huge difference.
If you are using a Delphi 6 - 7 version of the compiler, please use FastMM4 as your memory manager: SynEdit does a lot of memory allocation, and the older BorlandMM is much slower than FastMM4. With modern version of Delphi, FastMM4 is the default MM (Memory Manager).
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would consider myself a fairly competent programmer with experience in Java and VB.net. My latest swim around the programming lake is having me modify a program written in C. (The program is Wireshark, an open source network analyzing tool.) I followed the instructions here http://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html and simply don't know where to go from there. I'd like to use Visual Studio 2008 to work with the code if possible, but will do whatever is necessary. (I'm a total noob at using command prompt to do anything though.)
If you followed those steps, then you've built it. I'll copy Section 2.2.10 here.
2.2.10. Build Wireshark
Now it's time to build Wireshark ...
If you've closed cmd.exe in the meantime, prepare cmd.exe again
nmake -f Makefile.nmake all to build Wireshark
wait for Wireshark to compile - this may take a while!
run C:\wireshark\wireshark-gtk2\wireshark.exe and check if it starts
Just make changes in the code, do these steps over again, and presto! you've modified the program. You may want to bone up on C debuggers if you're doing anything very complicated.