|
I guess that would be a good approach. Thank you.
|
|
|
|
|
Have you ever tried Google Notebook? After installing the software, it will add a button at the bottom-right corner of IE. Dose anybody know how to implement that ? Any reply is appreciated.
Thanks
R.Y.J
|
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
i am trying to extract data from a file in c#.For this i match string "From" in the file .
if matched found the offset is calculated.
problem is this that for two matched string offset in calculated accurately.But for further offset is not accurate
althogh matched is found but offset is comes less that the actual string position
i write the code here it might be possible that function is not suitable
uint pos=m_dwStartPosition+4;
int eof=SRfin.Read(MatchString,0,4);
while(eof!=0)
{
MatchedString=new string(MatchString);
if(MatchedString=="From")
{
//that is problem
MessageBox.Show((m_startposition+pos).ToString());
}
pos+=1;
eof=SRfin.Read(single,0,1);
for (int i=0;i<3;i++)
MatchString[i]=MatchString[i+1];
MatchString[3]=single[0];
}
}
Parshant
|
|
|
|
|
In what way is the result not accurate? What do get, and how does that differ from what you expect?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I get an erratic behavior in my C# program.
The following statement
costWithDelete = RowVectorTwo[i - 1] + m_DeleteCost;
once in a while produces NaN on the right side with complete valid right side value.
The strangest thing is that it seems to be hapenning completely random.
My first suspicion was that I am messing up the memory somewhere,
but from what I know about C# (which is not much) is that
it does array bounds checking pretty thouroughly
Thanks,
David
|
|
|
|
|
There is nothing wrong with the code that you have shown, so the problem is in code that you haven't shown.
---
b { font-weight: normal; }
|
|
|
|
|
I know that much.
The problem is that this line is a piece of a fairly big project.
I have been trying to simplify it to locate the cause
but so far unsuccesfully.
In my experience this kind of problem is caused
by the memory being messed up.
And it can be done by any part of the program
seemingly unrelated to the one where the NaN shows up.
I wonder if there is a way in VS debugger to set up
memory access checking. I know such functionality
exists in Sun's debugger "workshop".
Also I was under the impression that C# does
very rigorous array bounds checking and such
would ocurr the whole program would crash.
|
|
|
|
|
It's not very common that the memory gets messed up nowadays. As you mention, C# does bounds checking, and you can't access memory outside a variable or array unless you use pointers in an unsafe code block.
A NaN value is represented by a bit value that starts with 7FF? or FFF?, so it's not very likely that some random data would produce a NaN value, it's much more likely that it would produce some other garbage value.
It's possible that you have some memory corruption, but I think that it's much more likely that there is some other bug in the code.
---
b { font-weight: normal; }
|
|
|
|
|
Is there anyway to stop the Update method for a TypedDataSet from requiring "Original_ID" as a parameter. With my schema (primary key, identity column that can NOT be changed) there is absolutely no conceivable reason for it to require the id to be passed twice. I have already modified the stored procedure so it only uses one, but .Update() still requires this.
So If I have a table with two colums, (table_id (int) and label (varchar(50))) the update method should look like this:
<br />
TestTableAdapter.Update(int table_id, string label)<br />
But now it looks like this:
<br />
TestTableAdapter.Update(int table_id, int Original_id, string label)<br />
and the stored procedure looks like this:
<br />
UPDATE Test SET label = @label WHERE table_id = @table_id<br />
I just don't get it.
|
|
|
|
|
Hi
i am trying to write a file. but i am getting an error. a small box is inserted whenever a line break is found. can anybody tell me its solution?
sAqIb
|
|
|
|
|
I'm sorry but they took away my power to read minds when I came to this planet.
Maybe you would like to tell us what the error is and how you are trying to write to the file?
only two letters away from being an asset
|
|
|
|
|
here is my code to write the file
FileStream file = new FileStream("Web.ini", FileMode.Truncate, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter ( file );
the file is written successfully, only the problem is that instead of getting line breaks in the written file, i get small square. (while i want the line break to be written)
sAqIb
|
|
|
|
|
What are you using to read the file you've written? You may be exhibiting what would seem to be a quite simple problem but actually causes a lot of problems - there is no standard on what a line break should be. Windows uses CRLF (0x0d0a) where as Unix and its Linux offshoots use just LF.
Somewhere in .NET, I can't remember where, there is a setting which allows you to control this.
Are you going cross-platform at all?
Regards,
Rob Philpott.
|
|
|
|
|
nope. i am using windows, neither unix nor linux. i am using StreamReader to read the file from which the string is returned, and then using that string i am writing another file.
sAqIb
|
|
|
|
|
Where is the box being displayed? In the debugger?
Regards,
Rob Philpott.
|
|
|
|
|
You have shown how you are creating the file but have not shown how you are writing to the file.
sw.Write(...)??
only two letters away from being an asset
|
|
|
|
|
ya i am using
sw.write (iniData);
to write to the file
the actual code is like that
if (charArray[i] == '\n')
sw.write "\n";
else
sw.write (charArray[i]);
well i have tried this statement too
if (charArray[i] == '\n')
continue;
else
sw.write (charArray[i]);
in both cases i get a small box in the file which is being written. i don't want that box to be written. i am sure its because of break line character. but when i use continue, i still get it (bcoz it is from teh input string ).
sAqIb
|
|
|
|
|
As has been said, the problem is the application you are using to read the file, not in how the file is written.
You can also use Environment.NewLine in place of '\n';
only two letters away from being an asset
|
|
|
|
|
if i am doing wrong then suggest me how to read the file?
but there are line breaks in the input file as well thats y there is \n is the input string too
sAqIb
|
|
|
|
|
Hi,
use '\r\n' instead of '\n'
hope this works.
Nitin...
|
|
|
|
|
Hi,
I have VS Studio .NET 2003 Academic. Yesterday, when I select the toolbox option all the tools are now (either) missing or 'grayed out'. How can I fix this? I reinstalled all the disks under the "repair" option, then restarted, but the problem still persists. Also, the project I was working on was a WinForm w/ out much of my own code added.
Please help and thanks for your time.....I'm wasting a lot of mine....
ps- I have also downloaded VS .NET 2005 Enterprise edition.
|
|
|
|
|
How can i loop a string in c#? is there any method? (remember its not a string array)
sAqIb
|
|
|
|
|
You mean to loop the characters in a string?
The string class has an enumerator for the characters, so you can loop the string as if it was an array of characters:
foreach (char ch in daString) {
...
}
---
b { font-weight: normal; }
|
|
|
|