|
Thanks to pavan and abhijit,
its working fine
|
|
|
|
|
Hi ,
Please help me for this i am tring a lot to get out of it but did not find solution.
I am using .net 2005 asp.net. In my code i use update panel and modal popup.And though i have alerady set Trigger properly following error is comming.
Sys.WebForms.PageRequestManagerParserException: The message received from the server could not be parsed. Common causes for thies error are when response.write(),response filters ,Httpmodules,or server trace is enabled. Details:Error parsing near '<html><head><scrip'.
like this.And this error is comming only at my client side and only for the one employee not for any other.
I am not able to reproduce this error at my end so how can i fix this error?
Please help me for this.
|
|
|
|
|
Hello everyone,
Is there any open source .Net open source content management platform like Sharepoint?
thanks in advance,
George
|
|
|
|
|
This[^]. BTW, what your question has to do with C#?
|
|
|
|
|
Thanks Navaneeth,
It is C# related because I am asking open source content management platform based on .Net technologies.
regards,
George
|
|
|
|
|
I will suggest you to Try DNN (DotNetNuke ) . Its Simply Great
|
|
|
|
|
Cool, thanks Abhijit!
regards,
George
|
|
|
|
|
|
Cool, Abhijit!
I like it.
regards,
George
|
|
|
|
|
|
Thanks Hamid,
What I want is to have open source developed based on C#.
regards,
George
|
|
|
|
|
It was good source for it and you can search for them on the Net.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thanks Hamid!
regards,
George
|
|
|
|
|
You're welcome.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I'm needing an algorithm for rotating points.
In my google searches, I've seen variants of this method several times:
void Rotate(ref Point p, Point centerPoint, double angle)
{
p.X = centerPoint.X + (int)((p.X - centerPoint.X) *
Math.Cos(angle)) - (p.Y - centerPoint.Y) * Math.Sin(angle));
p.Y = centerPoint.Y + (int)((p.X - centerPoint.X) *
Math.Sin(angle) + (p.Y - centerPoint.Y) * Math.Cos(angle));
}
When running this code in a loop, the radius gets smaller and smaller. Can anyone point me to a "usable" algorithm that will rotate a series of points? I know that the Matrix class has a rotate function but I would like to have more control over it.
Thanks,
Richard
My code this week has no errors. But it's Monday morning and I haven't got out of bed.
|
|
|
|
|
Hi,
whenever a series of operations is executed one step at a time, without any special precautions, and having a limited precision, you will end up with unwanted results; since you are always accumulating any error, however small, in the end it will show.
In your case your points are using integer coordinates, and your (int) cast will turn floats to their
integer approximation; it is flooring the absolute value of the number, hence moving it towards zero
all the time.
Three improvements are obvious:
1.
use real rounding, rather than flooring. This may or may not help, it typically is not good enough.
2.
perform all calculations using as much precision as is available, say double, and keep your "current point" in double; when needing its integer value, cast to (int), however for the next iteration, start off with the double values.
3.
also the trig functions have limited precision; if you rotate 360 times over 1 degree, you will not end up where you started; trig functions have an intrinsic error of a few LSb (least significant bit).
Solution: don't accumulate sine and cosine results, instead accumulate the angle, which basically means
you are always rotating the starting point to its newest position in a single computation.
BTW: even if you do this, in the end your point will spiral down to the center, due to the fact that
PI cannot be represented correctly, it is transcendental after all. So while sin(2*PI) is meant to be zero, it will be slightly off, and sin(200*PI) will be even more so.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:25 PM
|
|
|
|
|
Thanks for the response Luc.
Does anyone else have some code snippets that work for you in rotating an array of points?
My code this week has no errors. But it's Monday morning and I haven't got out of bed.
|
|
|
|
|
There are two problems with your code:
1. As Luc already mentioned, you are casting the values to int, which accumulates rounding errors. Use PointF structures to get better resolution.
2. You are using the new value for x when calculating the value for y. You need to first calculate both x and y from the original values, then store the new values in the Point structure. Actually, instead of changing a PointF structure you should return a new PointF value from the method:
PointF Rotate(PointF p, PointF centerPoint, double angle) {
return new PointF(
(float)(centerPoint.X + (p.X - centerPoint.X) * Math.Cos(angle) - (p.Y - centerPoint.Y) * Math.Sin(angle)),
(float)(centerPoint.Y + (p.X - centerPoint.X) * Math.Sin(angle) + (p.Y - centerPoint.Y) * Math.Cos(angle))
);
}
|
|
|
|
|
I'm following now. Thanks!
My code this week has no errors. But it's Monday morning and I haven't got out of bed.
|
|
|
|
|
I have an connected, open Socket with ProtocolType = IP. Before doing any sending/receiving, I try to use that Socket to Authenticate the client (in a LAN setting). I get this IOException, "Unable to read data from the transport connection: The connection was closed." When I check the Socket, Connected = True.
The code looks like this:
if (Authenticate)
{
NetworkStream clientStream = new NetworkStream(webSocket,false);
NegotiateStream authStream = new NegotiateStream(clientStream);
try
{
authStream.AuthenticateAsClient((NetworkCredential)CredentialCache.DefaultNetworkCredentials,
"",
ProtectionLevel.None,
TokenImpersonationLevel.Impersonation);
if (!authStream.IsAuthenticated)
{
Console.WriteLine("Authentication failed");
ErrorText = "Authentication using default credentials failed";
return (HttpStatusCode)(-1);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
ErrorText = ex.Message;
return (HttpStatusCode)(-1);
}
}
Any ideas?
|
|
|
|
|
How do I access a Logitech Momo wheel from C# ?
All I need is indicators for left/right turns from the wheel.
Johannes
|
|
|
|
|
Take a look at DirectInput, or XInput. For using these APIs from C# the best wrapper is probably SlimDX.
|
|
|
|
|
Hi
I have successfully applied the networking logic using TCP and UDP protocols both while on internal LAN scenario. Now how can I connect to the computer on network i.e. send a text message to another computer on the internet.
The target computer has the local ip address of 10.10.20.200 which is assigned from a local LAN server which is connected to the internet (you can think of a router too) now I dont know how to access that computer where a server is residing which will receive the message sent from the client.
Hope I was clear to illustrate the scenario and my question.
Regards,
Mujtaba Panjwani
Tiger Softwares
Software Designer and Developer
VB.NET, C#, ASP.NET, VFP
|
|
|
|
|
You need to look up NAT[^]
|
|
|
|
|
Hi
Thanks for the reply.
Can you please give me an example of how to discover NAT for the exact computer, I was thinking of a way to make the program work exactly as yahoo or msn messengers does i.e. sending a message to other computer or sending a file etc.
I will be very thankful for your help.
Regards,
Mujtaba Panjwani
Tiger Softwares
Software Designer and Developer
VB.NET, C#, ASP.NET, VFP
|
|
|
|