Search Results - CodeGuru Forums
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

# Search:

Type: Posts; User: sgsawant

Page 1 of 2 1

1. ## Thread: Timer in C++

by sgsawant
Replies
4
Views
643

### Timer in C++

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

int main(void){
clock_t start, finish;
start=clock();
cout<<start<<endl;
cin.get();
2. ## Thread: Efficient Normal Correlation between 2 vectors

by sgsawant
Replies
9
Views
1,517

### Re: Efficient Normal Correlation between 2 vectors

It's all Greek & Latin to me! :P
3. ## Thread: Efficient Normal Correlation between 2 vectors

by sgsawant
Replies
9
Views
1,517

### Re: Efficient Normal Correlation between 2 vectors

Thanks for the threading idea. Right now I am comfortable with classes. I also find the concept of "template" manageable. Keywords like "inline" etc. is where it becomes a bit difficult for me.

I...
4. ## Thread: Efficient Normal Correlation between 2 vectors

by sgsawant
Replies
9
Views
1,517

### Re: Efficient Normal Correlation between 2 vectors

Thanks for the tip to make flsq() inline.

5. ## Thread: Efficient Normal Correlation between 2 vectors

by sgsawant
Replies
9
Views
1,517

### Efficient Normal Correlation between 2 vectors

float crocor(float a[], float b[]){
float numerator=0;
float denominator=0;
float t1=0,t2=0,t3=0,t4=0,t5=0;
for(int i=0; i<=SCANRAD; i++){
t1+=a[i]*b[i];
t2+=a[i];
t3+=b[i];...
6. ## Thread: Inverse of a Matrix: Efficient Code (timewise)

by sgsawant
Replies
5
Views
5,408

### Re: Inverse of a Matrix: Efficient Code (timewise)

I was aiming for a range of 24X24.

I found a file through Google:
http://users.erols.com/mdinolfo/matrix.htm

He's shown an example with 200x200. In that regard I have a naive question to ask:
7. ## Thread: Inverse of a Matrix: Efficient Code (timewise)

by sgsawant
Replies
5
Views
5,408

### Inverse of a Matrix: Efficient Code (timewise)

I need to find the inverse of a matrix which contains floating point numbers. Can anyone share an efficient (w.r.t. time) code?

by sgsawant
Replies
2
Views
2,246

Awesome!
9. ## Thread: Convert int to string for use as FILENAME

by sgsawant
Replies
2
Views
2,246

### Convert int to string for use as FILENAME

void scanimg(IplImage *scnimg){
for(int k=0; k<SCL_NUM; k++){
ofstream localfile;
char s1[20];
std::stringstream ss1;
ss1<<k<<".csv";
s1=ss1.str();
localfile.open(s1);
for(int...
10. ## Thread: VS2008: Bookmarking & Good Practices Question

by sgsawant
Replies
3
Views
1,538

### Re: VS2008: Bookmarking & Good Practices Question

Thanks! Those links are real good.
I have tried asking people about resources on good tips. But I end up getting unrelated answer. This time again, it seems, my example was wrong but those links...
11. ## Thread: VS2008: Bookmarking & Good Practices Question

by sgsawant
Replies
3
Views
1,538

### VS2008: Bookmarking & Good Practices Question

Forgive this naive question:
Of what use is the "bookmark a line" option in VS2008?

Please tell if you know any good programming practices in VS2008. To clarify I would like to give an example:...

by sgsawant
Replies
6
Views
1,832

Perfect!
13. ## Thread: How to print (OR cout rather) custom error messages?

by sgsawant
Replies
6
Views
1,832

### Re: How to print (OR cout rather) custom error messages?

My apologies.
Here's the actual code:

void temp_match_img::makevec(){
if(radpix_set==0) cout<<"The values of the radpix[] array have not yet been calculated!\n";
int...
14. ## Thread: Debugging for beginner

by sgsawant
Replies
5
Views
577

### Re: Debugging for beginner

@alexibm
That was a hilarious post but on a serious note such has been the scene in my case too.

Currently I am somewhat comfortable with debugging, but the question I would like to put forth is...
15. ## Thread: Outputing a square.

by sgsawant
Replies
3
Views
469

### Re: Outputing a square.

void display()
{
char ch;
int i, j, side;
cout<<"Enter character and side"<<endl;
cin>>ch>>side;
cout<<endl;

for(int i=0; i<side/2; i++)
{
16. ## Thread: How to print (OR cout rather) custom error messages?

by sgsawant
Replies
6
Views
1,832

### How to print (OR cout rather) custom error messages?

assert() is a good way to notify errors but I want to cout an elaborate message.
Of course the following method will work but I needed something better:

if(error){
cout<<"Elaborate message";...
17. ## Thread: Number of pixels at radius r

by sgsawant
Replies
12
Views
2,328

### Re: Number of pixels at radius r

Oh.. ok. I was a bit concerned about the lower values. I guess if I manually enter the lower values the higher values can be estimated with reasonable accuracy as you have shown.
18. ## Thread: Number of pixels at radius r

by sgsawant
Replies
12
Views
2,328

### Re: Number of pixels at radius r

Sorry guys, by "in circle" I meant in the set represented by the circle. Basically the circumference.

The answer is not very close to 2*(pi)*r - neither is the answer for the number of pixels...
19. ## Thread: Number of pixels at radius r

by sgsawant
Replies
12
Views
2,328

### Number of pixels at radius r

I have written the following code to derive find out the average intensities at a given radius from the center of an array.

void temp_match_img::makevec(){
int temp;
20. ## Thread: Passing String to a Function

by sgsawant
Replies
6
Views
2,464

### Re: Passing String to a Function

@CILU:

Thanks! I will remember this one.
21. ## Thread: Passing String to a Function

by sgsawant
Replies
6
Views
2,464

### Passing String to a Function

I know the following will look weird but I am simply not able to understand how string passing works.

#include<iostream>
#include<ctype.h>
#include<fstream>
using namespace std;

void...
22. ## Thread: Fundamental Question in Organizing

by sgsawant
Replies
4
Views
560

### Re: Fundamental Question in Organizing

Thanks! But what is the resource folder for?
23. ## Thread: Fundamental Question in Organizing

by sgsawant
Replies
4
Views
560

### Fundamental Question in Organizing

When I create an empty Win32 application in VC++, I see 3 folder icons to my left (in the environment):

Resource files
Source files

I create main.cpp in the "source files" and a...
24. ## Thread: A noob question on arrays:

by sgsawant
Replies
6
Views
686

### Re: A noob question on arrays:

Thanks! So basically it's the best to be as clear as possible - esp. if one is ready to punch in those extra characters.

Please correct if wrong.
25. ## Thread: A noob question on arrays:

by sgsawant
Replies
6
Views
686

### Re: A noob question on arrays:

#include <iostream>

int a[20][20];

int main()
{
std::cout << a[9] << "\n";
std::cout << &a[9] << "\n";
std::cout << &a[9][0] << "\n";
system("pause");
Results 1 to 25 of 27
Page 1 of 2 1

Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.

Featured