|
lawrenceinba wrote: then can u also tell me wat we should use instead of pointers in c#
C# uses references. An instance of a class is passed as a refernce, an instance of a struct is passed by value. It is handled implicitly by the run time, you don't have to explicitly use them like you do in C++.
lawrenceinba wrote: the program has to convert it into the standardise format
Step 1 is to define what you mean by "the standardised format"
|
|
|
|
|
standard format like this
1.house no
2. streeet name
3.city
4 district
5. country
and so on
also it should remove spelling mistakes.....
n number of address will be passed and using hmm training we should train and make the output efficient
|
|
|
|
|
lawrenceinba wrote: standard format like this
1.house no
2. streeet name
3.city
4 district
5. country
That doesn't tell anyone enough. How are the parts of the address separated from one another? Is it in XML, field length delimited, comma separated, etc.
lawrenceinba wrote: it should remove spelling mistakes.....
From an address? How is it going to know that? Do you have a dictionary of approved spellings?
lawrenceinba wrote: using hmm training we should train and make the output efficient
What is "hmm training"? Is that some sort of generic algorithm?
Define what you mean by "efficient" output.
|
|
|
|
|
Do your own homework.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
lawrenceinba wrote: guide me from begining to end
It is your homework - How about you trying to do it then if you get stuck come back and ask for specific help.
lawrenceinba wrote: a migration project in
"text parsing or automatic segmentation of text"
That is a bit on the vague side. A project title tells people very little about what it actually needs to accomplish. How about if I tell you the project title of what I'll be doing in January: "Opera Integration upgrade to version 5" - Now, what does that actually tell you?
|
|
|
|
|
Colin Angus Mackay wrote: How about if I tell you the project title of what I'll be doing in January: "Opera Integration upgrade to version 5" - Now, what does that actually tell you?
It tells me that you're working on a sideline project providing scaffolding for the dresses of the "waif-like" opera singers.
|
|
|
|
|
Pete O'Hanlon wrote: It tells me that you're working on a sideline project providing scaffolding for the dresses of the "waif-like" opera singers.
Nice try! But, ultimately, incorrect.
|
|
|
|
|
ya i'll be doing i just need help from u guys
|
|
|
|
|
Well, when you have something specific that we can help with then please let us know.
|
|
|
|
|
Hey,
I have a List of Points that makes up a line getting from users input. What I would like to do is take the list and create a new list of points where all the points are evenly spaced with an equal, or set distance apart. Does anyone know of the best way to do this, or any good resources to look at. I've searched around but not been able to find what i'm looking for.
Thanks
--
John
http://blog.yeticode.co.uk
|
|
|
|
|
How about this.
void AddMidpoints(List<Point> points) {
for (int i = points.Count - 1; i >= 1; i -= 1) {
points.Insert(i, midpoint(points[i], points[i - 1]));
}
}
Point midpoint(Point p1, Point p2) {
return new Point(((p1.X + p2.X) / 2), ((p1.Y + p2.Y) / 2));
}
|
|
|
|
|
I understood the question as taking a line created by a number of points and creating a new set of points that construct the same line, but with the same number of points evenly distributed across the line. If that is the case, here is a solution. Theoretically, all you need to do is calculate the length of the line and divide it into even segments according to the number of points provided by the user. Where P1 and P2 are the end points of the line, and n is the number of points provided by the user; you can calculate an x offset as (| P1.X - P2.X |) / n and a y offset as (| P1.Y - P2.Y |) / n . You can then construct a collection of points containing the first and last point provided by the user along with an additional n - 2 points (indices 1...n-1) where the X coordinate = P1.X + (index * x offset) and the Y coordinate = P1.Y + (index * y offset) .
Pseudocode:
N = userPoints.Count
P1 = userPoints[0]
P2 = userPoints[N - 1]
xOffset = Abs(P1.X - P2.X) / N
yOffset = Abs(P1.Y - P2.Y) / N
List newPoints = new List(N)
newPoints.Add(P1)
For I = 1; I < N - 1; I++
newPoints.Add(new Point(P1.X + I * xOffset, P1.Y + I * yOffset))
newPoints.Add(P2)
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi,
I admit your approach is very KISS, however I doubt this is the right answer. You are assuming it is a straight line, but then why would the OP start of with a collection of points to define the line? It looks more like: here is a number of points, imagine a fluent line that goes through all of them and come up with new point that lie on that fluent line but now are equally spaced. So you might try some Bezier curves and calculate lengths on those (something I haven't encountered before).
|
|
|
|
|
Hello all and Happy new Year
I have a UserControl which contains a Label and a TextBox and I want to set the Label's Text in my main form. I know I can get a string as parameter in UC's constructor or define the Label, publicly. But I wonder if I can set the Text in Design mode. I mean is there any way to add a property for my UC so when I open Properties tab I can see that and change its value?
I hope I could explain well.
Thanks a lot
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
|
Actually I didn't know from where I should start. I tried constructor but I have error adding UC in my windows form. I defined the Label publicly but I could only access the Label this way: UserControl.Label . I searched MSDN for Property and Attribute but I couldn't find anything yet.
Thanks for reply
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
You can override the Text property of the usercontrol so as to set the entered text into the label.
Something like what is given below.
[Browsable(true)]
public override string Text
{
set
{
label1.Text = value;
}
}
This will let you set the text in design time.
|
|
|
|
|
Yes, that's the answer: [Browsable(true)]
You made my day, thanks a lot
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
I created two instances of my UC in my Form and when I change the Text value of one of them, both will change! I wrote code below:
[Browsable(true)]
public string LabelText
{
get { return label1.Text; }
set { label1.Text = value; }
}
I couldn't understand what is the problem, do you have any idea?
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
I just tried using the same code that u gave and it seems to work fine for me. Can you give me the code for the control and also the code for ur form. It might help.
|
|
|
|
|
How is the label1 defined in your UC, is it static or any other reasons why it could be shared along the instances?
|
|
|
|
|
Solved Mika and Member 4470354,
I think I was changed PropertyBinding, DatBinding or I don't know, something similar...
I reset the values.
Thank you both.
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
Hello people:
I have been trying hard to find a way to customize the to part in th email address, with no avail. Can you be of help?
I am creating a refer the link webpart where i get the name and email for the TO and the name and email for the FROM. I can achieve the basic functionality using the SendMail but the I want the From part in the email to appear like this -
From: name(sender@senderDomaain.com)
So if Sam sent an email to Samantha and Sam's email address was sam@gmail.com. The from should look like this -
From: Sam(sam@gmail.com)
To: samantha@gmail.com
Any idea how i can append the name to the from email id ?
- Cheers
|
|
|
|
|
Hi guys,
I'm writing a SQLite wrapper but I'm having trouble handling pointers.
Example:
Original C function (from SQLite doc):
const char *sqlite3_column_name(sqlite3_stmt*, int N);
Import in C#:
[DllImport("sqlite3.dll", EntryPoint = "sqlite3_column_name")]
private static extern string sqlite3_column_name(IntPtr sqlite3_stmt, int N);
This works, but sometimes (I dont understand why yet) it gives me back an Access Violation Exception.
The same happens with this:
const char *sqlite3_libversion(void);
[DllImport("sqlite3.dll", EntryPoint = "sqlite3_libversion")]
private static extern string sqlite3_libversion();
That always raise an Access Violation Excpetion.
What I'm doing wrong?
Thank everyone in advance.
-MR
|
|
|
|
|