win32 toolbar placement too low
I am just learning win32 ui and scraped an example tool bar off of Microsoft's documentation. When I run this plain example, the result is that the tool bar is too low. I can't figure out why this...
View ArticleAnswer by Commodore63 for win32 toolbar placement too low
Issue appears to be that I wasn't returning 0 from either the WM_CREATE or the WM_PAINT message and still calling the DefaultWindowProc().Working code: case WM_CREATE: MainWindowToolbar( Window );...
View Articleusing File().byLine() with fold()
I am trying to use the fold operation on a range returned by byLine(). I want the lambda which is passed to fold to be a multi-line function. I have searched google and read the documentation, but...
View ArticleAnswer by Commodore63 for using File().byLine() with fold()
I was able to tweak the answer provied by Akshay. The following compiled and ran:module example;import std.stdio;import std.algorithm.iteration : fold;void main() { string fileName = "test1.txt"; auto...
View ArticleWPF: Datagrid sorts Listbox bound to the same collection
I have two WPF elements bound to the same ObservableCollection. One is a Datagrid and one is a ListBox. When the Datagrid is used to sort on a column (using the built-in column headers) the action puts...
View ArticleAnswer by Commodore63 for C: Numerical Recipies (FFT)
The reason is for numerical accuracy. If you closely examine the following code:wtemp=sin(0.5*theta);wpr = -2.0*wtemp*wtemp;wpi=sin(theta);andwr=(wtemp=wr)*wpr-wi*wpi+wr;wi=wi*wpr+wtemp*wpi+wi;they are...
View ArticleAnswer by Commodore63 for I am attempting write a class that multiplies two...
int Frows = FM.length;int Fcolumns = FM[0].length;int Srows = FM[0].length;int Scolumns = FM.length;should be int Frows = FM.length;int Fcolumns = FM[0].length;int Srows = FM.length;int Scolumns =...
View ArticleFFMPEG Stream series of pictures over network
I would like to generate video frames on one computer and stream them to another computer to be manipulated and displayed. I want to do this programatically, because the source images are generated...
View ArticleAnswer by Commodore63 for FFMPEG Stream series of pictures over network
The key was to use avio_open2() to open the socket connection and then pass the data and size fields of pkt to avio_write(). He is an example working program (derived from decode_encode.c in the...
View ArticleAnswer by Commodore63 for How can I make Java draw a shape based on input in...
The easiest way to to define working coordinates with respect to the center of your window, then translate before drawing://Lager Flagget makeWindow("Flagg", 500, 500); String innStr = getText...
View ArticleAnswer by Commodore63 for access local variable from outsie it scope c++
If you are having problems with performance, it is probably due to the line:CvMoments moments = (CvMoments)malloc(sizeof(CvMoments));If trackObject() is called frequently, malloc is expensive to call...
View ArticleAnswer by Commodore63 for remove at index linked list
You are updating a local variable. What you need to do is update the link prior to the current node: if (k == 0) { first = first.next ; // you also have to free the memory for first. } else { Node Last...
View ArticleAnswer by Commodore63 for Mathematically navigating a large 2D Numeric grid...
The best method is to factor e into it prime components. Lets say they are as follows: {a^m, b^p, c^q}. Then you build set for each power of e, for example if m=2, p=1, q=3,e^1 = {a, a, b, c, c, c}e^2...
View ArticleAnswer by Commodore63 for Dos and Don'ts of Conditional Compile
Another pragmatic use of conditional compiles is to "comment out" sections of code which contain standard "C" comments (i.e. /* */). Some compilers do not allow nesting of these comments, for...
View ArticleAnswer by Commodore63 for Quaternion Interpolation w/ Rate Matching
First of all your rotational rates about each axis should compose into a rotational rate vector (i.e. w = [w_x w_y w_z]^T). Then you can separate the magnitude of the rotation from the axis of the...
View ArticleAnswer by Commodore63 for Text editor with autocomplete for C/C++ and...
I recommend Eclipse. It does highlighting and code completion. On the download page choose "Eclipse IDE for C/C++ Developers."
View ArticleAnswer by Commodore63 for Using C, how can I access the same block of memory...
If you are in a unix environment you can use shmget() and shmat() to create and attach a shared memory segment. Both process assess the segment via a common integer key.
View ArticleAnswer by Commodore63 for strncmp proper usage
I sense that you are using strncmp to prevent buffer overflow, however, the message is already copied into memory (i.e. the message buffer). Also, the prototypeint strncmp ( const char * str1, const...
View ArticleAnswer by Commodore63 for C Programming fopen() while opening a file
You may not have permission to create/write to a file in the directory that the user chooses. You will have to handle that error condition.
View ArticleAnswer by Commodore63 for Combine Rotation Axis Vectors
You should use unit quaternions rather than scaled vectors to represent your rotations. It can be shown (not by me) that any representation of rotations using three parameters will run into problems...
View Article