|
TARAK NATH ROY wrote: i have number of points(x,y) near about 1000.If i plot all these points in graph paper then it looks like a polygon.And polygon is combination of lots of curve and lines
OK, I think I understand a bit better now. You have a large list of points, and want to draw a figure from them, using straight lines and curves to best fit the shape. Although to be technically correct, a polygon is a shape made of only straight lines, I get what you mean.
So, you need to go through the list, finding the sections which are best drawn as straight lines, and which are best as curves. My previous suggestion about matching slopes is probably still a reasonable way to try, but over limited ranges of points.
If you calculate the slope between points (Xn, Yn) and (Xn+1, Yn+1) as (Yn+1 - Yn) / (Xn+1 - Xn) then you can compare the slope values as you step through the list (increasing n).
If consecutive slopes are equal, or better, if the difference between them is less than some small constant, then the group of points are all very close to being a straight line. If you get a change in slope, greater than your limit value, then you've entered a curve region.
As you go through the points you can either copy them to separate line and curve lists, or possibly note the indices where the type of line changes.
Drawing the straight lines is easy, however you may have to look at your data more closely to find the best curve drawing method to give a good match.
Here's a rough pseudo-code version of what I'm describing above :-
lastSlope = 0;
for (int n=0; n<numPoints; ++n)
{
slope = (Y[n+1] - Y[n]) / (X[n+1] - X[n]);
if (abs(slope - lastSlope) < smallValue)
{
}
else
{
}
lastSlope = slope;
}
I hope that helps you a bit...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
As an alternative to my last post, you could always try just drawing straight lines between the points, and seeing what it looks like.
I have an audio waveform display in the project I'm currently working on, and I just join all the sample values with straight lines, which looks fine since there are so many of them in the view.
You might get away with just doing that...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
After installing WSE 3.0 Runtime, the option for WSE setting is not available when you right click on the slolution.Even there is no "WSESettingsVS3.Addin" file available at "C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins " location. Does anybody know the reason behind this ?
|
|
|
|
|
Dear Friends.
Actually i need to debug my setup projects. which is is Release mode.
i can able to debug my projects in Debug mode.
whats is wrong in my coding
public override void Install(System.Collections.IDictionary stateSaver)
{
try
{
System.Diagnostics.Debugger.Launch();
//----
// My Stuff here
//----
}
catch (Exception ex)
{
}
}
And also i tried this instead of
System.Diagnostics.Debugger.Launch();
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
#endif
Please tell me, the solution to debug my project in Release mode.
|
|
|
|
|
Seems you don't have a clear idea about the Debugging API. What you exactly want to do? Tracing any problem happens during the setup? ...you can use logging for that.
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
Dear Friends.
How to run .net application on Macintosh operating system. .net WMI works on Macintosh Operating System or not.
Please help me resolved this problem.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
What you need is The Mono Project, which should do what you are looking for.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
but The Mono Project not support all namespace of .net for example:-Wmi,Drive Info and Etc
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
Eventure Technology
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Ah, sorry - I didn't take in the reference to WMI in your original post.
Mono is an ongoing project, and continually being added to. Unfortunately, if you need something that isn't currently implemented there's not much you can do. I'm surprised DriveInfo isn't in yet though.
As far as I know Mono is the only real way to get .Net apps running under OS-X. Perhaps you can write work-arounds using the features which are implemented?
edit : DriveInfo is implemented in Mono. Perhaps the features of WMI that you need are also available. It would be worth checking.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
|
Hi,
seems like you have a null object inside ExecuteOrder() at BookStoreWebService.asmx.cs:line 60
you should fix that.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
don't delete your messages; it results in a messy forum.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hello everyone ,
I have an issue i.e, I am using crystal report(version 11 release 2) in my windows applications developed in vb.net (2005)and sql server(2005) as backend . In one of the forms i placed one reportviewer control,
crystal report taking long time for preview & print(nearly 2 minute) .
please any one help me to getout of this
Dim rpt As New CrystalReport1() 'The report you created.
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand()
Dim myDA As New SqlDataAdapter()
Dim myDS As New Dataset1() 'The DataSet you created.
Try
myConnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;" & _
"Initial Catalog=northwind;")
MyCommand.Connection = myConnection
MyCommand.CommandText = "SELECT * FROM Customers"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "Customers")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Advance thnx.
|
|
|
|
|
You're selecting everything from the customers table to add to the report. Is this where the bottleneck is? Do you need to select all of this data?
|
|
|
|
|
thnx for Ur replay.
I am taking one record only using where condition,but that time also this report taking more time for first preview,next preview its taking less time compare to first preview.
|
|
|
|
|
If your database connection has not been pooled, then the first preview will take a lot longer than the second time where it's pulled from the pool.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Is the column you are referencing in your where clause defined by an index ?
Use the "show execution plan" option in query analyzer to make sure the query is not doing table scans.
Optimize the query first, then the report should work fine.
|
|
|
|
|
Hi,
I m manjari.let me tell u the problem while doing my work in my company.when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password.if valid then it will goes to print spool.I hv done the program after going to print spool it already detect the person but i want before goin to print spool it should detct.anybody plz help me as soon as possible.
thanks,
regards,
manjari
How i will design a a form in windows service to print a document.
|
|
|
|
|
manjari kar wrote: when ever a person click the print option to print a document it should detect the person and that time instead of print dialog box our window should display with username and password
If you want to show a username/password dialog before the print dialog then you should create one and call ShowDialog on the username/password dialog before the PrintDialog.
manjari kar wrote: How i will design a a form in windows service to print a document.
You cannot. A windows service has no user interface and can run without there being any user logged in.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
thanx for responding.plz giv eme ur answer depictly with code .becoz i tried a lot .but i didnt get result.plz help me.and nw again i briefly tell u the task.suppose in ms word or in notepad or in pdf file ,when a person is going to click the print option in file menu thattime our window should display instead of print dialog popup.if valid then it goes to print dialog popup for print that document.
i hv done my task like this.after clicking the print option printdialog popup is comming,then clicking ok my window is displaying and asking for username and password.but i want before that print dialog popup it should display.plz helpme and give me a right path.
my code is like this :
private void timer1_Tick(object sender, EventArgs e)
{
PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
if (job.Submitter == "gyana.manjarikar")
{
job.Pause();
}
if (true)
{
//MessageBox.Show(job.Name.ToString());
this.Show();
}
else
this.Hide();
}
}
}
private void btnlogin_Click(object sender, EventArgs e)
{
int copies=10;
this.Opacity = 50;
PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
//if (txtUserName.Text == "aaa" && txtPassword.Text == "bbb" && copies <= 10)
//{
// job.Restart();
//}
if (job.Submitter == "gyana.manjarikar")
{
if (txtUserName.Text == "aa" && txtPassword.Text == "bb" && copies <= 10)
{
timer1.Dispose();
job.Resume();
this.Hide();
}
else
{
lblErrormsg.Text = "Invalid UserName Or Password";
}
}
else
{
this.Show();
timer1.Start();
lblErrormsg.Visible = true;
lblErrormsg.Text = "Invalid User";
}
//if (job.Submitter == "")
//{
// job.Pause();
//}
//else
//{
// lblErrormsg.Visible = true;
// lblErrormsg.Text = "Invalid User";
//}
//if ( txtUserName.Text == "aa" && txtPassword.Text == "bb" )
//{
// job.Pause();
//}
//else
//{
// lblErrormsg.Visible = true;
// lblErrormsg.Text = "Invalid User";
//}
}
}
}
private void btncancel_Click(object sender, EventArgs e)
{
this.Opacity = 50;
this.Hide();
PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
if (job.Submitter == "gyana.manjarikar")
{
job.Cancel();
}
}// end for each print job
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.Opacity =100;
}
}
}
plz help me where and what i will change here.
How i will design a a form in windows service to print a document.
|
|
|
|
|
that is unreadable.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I have a program that runs with active user sessions. How to modify the MSI packaging so that installation would also add the program to Services?
|
|
|
|
|
First of all you must modify your program and make it into a service.
Writing a system service is different than writing a user mode program in a few ways.
You should have a look at some articles on the web, you can start from here[^] for example.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Hi -
I've got Visual Studio 2005 and I'm trying to create a SQL Server Project on a 2008 Server.
I'm trying to make a 'New Database Reference' with the following settings:
Data Source: SqlClient
Server: <servername>
Windows Authentication
I'm able to successfully test the connection and find the correct database (catalog).
The problem is that I get a message - "This Server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later"
Anyone see or overcome this before?
Thanks in advance!
|
|
|
|
|
You need to install VS 2005 SP1 and also a path on top of it.
Look into the following link[^]
|
|
|
|