|
Thank you Ihoecken !
I'll go through that algorithm.
I need the vertices/points of the polygon.
|
|
|
|
|
Thank you Corrina for your reply.
I'm using the GraphicsPath before regions because I'm creating polygons.
i.e polygons added to Graphicspath and then regions are created using the paths.
After that I'm complementing both the polygons and then I need the vertices/Points of the complemented polygons.
Pixels won't help me, could you please suggest something else.
Secondly, Could you please tell me what the RegionData().Data is all about?
|
|
|
|
|
hi guys !
need some help..
i want to match whole words in my string using regular expression
i m using Regex.IsMatch function for this and using "\b" as start and end tags for matching the word as a whole
every thing is working fine but
if some special character comes with the words like '***SPAM***' it throws an exception
"Argument Exception , nested quantifier?"
can any one help me how to deal with this as i also want these special characters to be matched.
moreover there could be any special character which could occur n numver of times in the word.
how to deal with that.
abhinav
|
|
|
|
|
Use the Regex.Escape method to escape the characters in the string, so that you can use it in the regular expression.
---
b { font-weight: normal; }
|
|
|
|
|
thanx for the reply guffa
but can u explain it with a small example if possible.
thanx again
abhinav
|
|
|
|
|
A possibly easier solution would be to write the string (if hard-coded in the code) as:
string regex = @"regex-goes-here";
The @ symbol tells csc not to escape the C# characters like '\n', '\t' etc.
(The Regex class can do this anyway when passed a literal string.)
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Example:
string word = @"c:\dir\body.txt";
string pattern = @"\b" + Regex.Escape(word) + @"\b";
Regex re = new Regex(pattern);
---
b { font-weight: normal; }
|
|
|
|
|
Hi!
thanks again for the reply guys.
i tried the Regex.Escape method.
it works good and don't throw any exception but it do not match the whole word also.
m i again missing some thing..
here is my code:
<code>public bool sSearchWholeWord()
{
string sSearchWord="***SPAM***";
string content="hi this is ***SPAM*** testing";
string pattern = @"\b" + Regex.Escape(sSearchWord) + @"\b";
Regex re =new Regex(pattern,RegexOptions.IgnorePatternWhitespace);
try
{
if(re.IsMatch(content))
{
return true;
}
else
{
return false;
}
}
catch(Exception e)
{
Response.Write(e.ToString());
return false;
}
}</code>
this returns false but according to me it should return true
i dont know what m i missing
abhinav
|
|
|
|
|
I have an application that runs using Schedule task every morning. I want to create a coding that will send an email to the user after the application runs in the morning.
Please help.
boboza
|
|
|
|
|
System.Net.Mail namespace if you're using Framework 2.0
System.Web.Mail namespace if you're using a prior Framework version
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
This is so stupid and yet I can't find the solution:
On my winform I have two comboboxes that have exactly the same DataSource, displaymember and valuemember.
Now I execute the same sql-statement twice and bind the dataset to the datasource, which works perfectly. Because of the amount of data to be loaded (on the entire form) it takes a bit long to show the form and that's why I need to speed it up.
Here's where my problem starts. I've tried to set the datasource of 1 combo = to the other one. Apparently he copies the address so both datasources point to the same Dataset. If you change one combo in your form, the other one gets the same value.
What I actually need is that the DataSet (or DataSource) value is copied, not the address.
tnx for your help...
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
GEt your datasource, use the Clone() method to make a copy, then assign one to each.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks, but I'm still doing something wrong ??
This is my code, but my combo's are empty.
<br />
combo_state.DataSource = dbc.GetDataSet().Clone().Tables[0].DefaultView;<br />
combo_nationality.DataSource = dbc.GetDataSet().Clone().Tables[0].DefaultView;<br />
combo_state.ValueMember = "country_id";<br />
combo_state.DisplayMember = "lbl";<br />
combo_nationality.ValueMember = "country_id";<br />
combo_nationality.DisplayMember = "lbl";<br />
thanks again.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
hi,
take Clone() operation first in your code.
DataSet _ds=dbc.GetDataSet().Clone();
then assign it to combo source.
combo_state.DataSource=_ds.Tables[0].DefaultView;
|
|
|
|
|
this:
DataSet _ds=dbc.GetDataSet().Clone();<br />
combo_state.DataSource=_ds.Tables[0].DefaultView;<br />
equals:
combo_state.DataSource = dbc.GetDataSet().Clone().Tables[0].DefaultView;
I think, no?
But I found the problem. Clone() only copies the structure. no data. You have to use the Copy() method to copy the data and the structure.
like this:
<br />
combo_state.DataSource = ((DataView)combo_nationality.DataSource).Table.Copy().DefaultView;<br />
combo_state.DisplayMember = "lbl";<br />
combo_state.ValueMember = "country_id";<br />
tnx for the help.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
yes. your answer is right
|
|
|
|
|
|
Hello!
I have a problem, I'm trying to read an XML-file that may contain characters from different languages, like for example swedish, danish or german non-ascii characters.
when i load the reader into my xmlDoc, i get an exception telling me that one of the caracters is invalid.
is there any setting i can do to make the xmlreader ignore what kind of caracters the element includes?
Can i have something to do with the header (i have xml-files with no header)
example xml:
<rootNode>
<firstChild>
<grandChild>normal</grandChild>
</firstChild>
<secondChild>
<grandChild>äää-not-normal</grandChild>
</secondChild>
<rootNode>
kind regards
Andreas
-- modified at 2:52 Friday 4th August, 2006
|
|
|
|
|
Specify the encoding when you create the streamreader. Example:
StreamReader reader = new StreamReader(fileName, Encoding.GetEncoding("windows-1250"));
---
b { font-weight: normal; }
|
|
|
|
|
I recommend fixing the XML document instead of trying to make your program read invalid XML.
See for example here[^]
The default encoding is UTF-8, if you use anything else you must
a) Specify it in the header
b) Kill yourself to save the world from yet more ANSI junk. Only exception is if you use another Unicode encoding (UTF-16 for example), but normally this is not needed.
|
|
|
|
|
First of all, what is your code, what reader are you using? An xml reader, DOM, SAX, or a text reader?
No doc type (header)?? That's actually not valid XML. Is it possible to include it? Short of a Byte order mark, w/o the doc type there is NO way to accurately figure out the encoding of file.
If you can't add the doc type to your XML doc, you must specify the encoding in your code. UTF-8 would be a safe guess.
-- modified at 3:03 Sunday 6th August, 2006
-- modified at 3:04 Sunday 6th August, 2006
/\ |_ E X E GG
|
|
|
|
|
Hi,
I want to know is it possbile to add a user to windows programtically? if yes,please point me to the header files and Dll which i should add in my Project for doing this and the method call i should perform for doing this.
Thanks in Advance
Deepa
|
|
|
|
|
|
hi all i have this pro on hand now.. i have downloaded some sample database applications from the internet..however when i want to debug it i gives me the error--An unhandled exception of type "system.Data.OleDb.OledbException" occurred in system.data.dll
does this errors occur due to where the dB file is located..is it correct? can someone out there help will this pro? and maybe guide me to correcting it ..thanks in advance..
an extract on of codes where the problem is highlighted is below:the pro is bold...thanks in advance
private void fclsMain_Load(object sender, System.EventArgs e)
{
m_cnADONewConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\contacts.mdb";
m_daDataAdapter =
new OleDbDataAdapter("Select * From Contacts",m_cnADONewConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtContacts);
this.ShowCurrentRecord();
one of the ans i got is entering cnADONewConnection.Open();
before m_daDataAdapter.Fill(m_dtContacts);
but i got an error like this C:\Documents and Settings\STUDENT\Desktop\Database Example\Form1.cs(235): The type or namespace name 'cnADONewConnection' could not be found (are you missing a using directive or an assembly reference?)
can anyone please give me more detailed help as im really new to this
|
|
|
|
|
Make sure you have all the DLLs needed on your machine, and then make sure they are all referenced.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|