Comment by Commodore63 on How to set vertical text in the column headers of...
Note that this approach interferes with the column resizing behavior of the datagrid.
View ArticleComment by Commodore63 on How to set vertical text in the column headers of...
This approach allows column resizing behavior as expected. +1.
View ArticleComment by Commodore63 on How to Write a single byte to a file in C++, while...
After the write, seek to the end of the file before closing it.
View ArticleComment by Commodore63 on How do I lock the camera horizontal rotation if...
mov.speed > mov.speed is always false.
View ArticleComment by Commodore63 on C: Pointer arithmetic and malloc() - NO GO?
When you are trying to understand code like this I find it helpful to step through it in a debugger and see how each line changes variables, memory, etc, it is way better than seeing a blast of printfs...
View ArticleComment by Commodore63 on Problem in deleting blank lines in exercise 1-18 (K&R)
On page 29, K&R have an example which provides code which does a very similar function to what you are trying to do. I suggest that you start with that and understand it. Then modify it to do what...
View ArticleComment by Commodore63 on Segmentation fault while searching data in a txt...
Step through your code in a debugger and watch it execute. Second,when parsing text files performing a seek based on number of characters is bad practice. i.e. don't do this: fseek(openedfile,175,...
View ArticleComment by Commodore63 on A function to check if the word has an increasing...
Your for loop works, but is not the idiomatic way to cycle through characters of a string for(i=1; str[i]; i++) . It would be better to use for(i=1; i<strlen(str); i++)
View ArticleComment by Commodore63 on Pick user's choice on button click
what do you mean is not printed correctly. What is your print statement? What is the output? What do you mean by "I can see the right value"?
View ArticleComment by Commodore63 on Hanning Window Bandwidth
Yes, there is a connection. The bandwidth of the windows is typically referred to as the noise bandwidth, which is 1.0 for a rectangular window and 1.5 for the Hann window.
View ArticleComment by Commodore63 on InFix to PostFix function Operator don't show
If I read your if statement correctly, it only runs when expression[i] is not an operator.
View ArticleComment by Commodore63 on c++ search for a specific file (text.ini) and list...
@Andy, did you try FindFirstVolumeW() and FindNextVolumeW()?
View ArticleComment by Commodore63 on using File().byLine() with fold()
Thank you. That makes sense. I am relatively new to D and find the documentation lacking regarding templates and function literals. This cleared things up for me a lot.
View ArticleAnswer by Commodore63 for Opening Files for Edit
You could use the errno to get a hint as to what is going wrong:#include <stdio.h> #include <stdlib.h> #include <errno.h> /* new */int main (void) { if((cfPtr = fopen("test.dat",...
View ArticleAnswer by Commodore63 for Finding characters within a string in C
The information regarding how many asterisks you found is stored in the counter j. This variable gets reset in the for loop:for(j=1; j<=i; j++)Furthermore, this for loop goes all the way up to i,...
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Articlewin32 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 Article