|
Wow, that's pretty sickening. No wonder I don't use that McAfee crap.
Logifusion[^]
|
|
|
|
|
Hi All,
I got a problem where I want to draw some lines on a Map(JPEG, BMP, GIF), and data for these lines are in Latitude and logitude form. I have some idea that I can do it by Drawing object(GDI object), but converting latitude and longitude data into pixels might be error prone.
Can anybody help me ?
Is there any efficient way for doing it ?
Please let me know.
Thanks
Sandeep
|
|
|
|
|
We had some good discussion about lat/lon to distance conversion around this article.
Search CP for "GPS" and you can get more.
Best,
Jun
|
|
|
|
|
I suggest you become very familier with coordinate systems as you attempting to plot a coordinate system designed for a 3D sphere (ish) onto a 2D image. There are so many approaches depending on what you know about the image(s) that you need to study them all. Drawing a black blob on the image is the least of your worries.
I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerrywww.many-monkeys.com
|
|
|
|
|
I am developing a Save method in my business Process that allows me to Save the current object (scheme) and all it child collection objects, so that all I need to do is call bp.Save(Scheme) and it saves via reflection the entire tree.
I have a class "Scheme" which contains as properties a number of ReadOnlyCollections e.g. ReadOnlyCollections<milestone> and ReadOnlyCollections<partner>.
"Milestone", "Partner" and "Scheme" have a "Save" method and inherit from the same object (hcdbEntity).
I want use Reflection to call the "Save" method on the Scheme and each Milestone in the collection(becuase I have many other collections hanging off Scheme and Milestone) and don't want to hard code.
When I view the property info for the scheme I have to check for contains "ReadOnlyCollection" as the property.PropertyName holds "ReadOnlyCollection'1".
property.PropertyType = {Name = "ReadOnlyCollection`1" FullName = "System.Collections.ObjectModel.ReadOnlyCollection`1[[Business.Entity.Scheme.SchemeMilestone, Business.Entity.Scheme, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"}
The currentValue that gets returned by calling the Invoke method returns a list of the seperate items in the collection, but gives me no way to process them individually, or get a handle on them to call the Invoke method to call their Save method, or to be able to transverse down the tree to call collections further down as required.
private void DoA(HcdbEntityClass entity)
{
Type t = null;
System.Reflection.PropertyInfo[] properties;
object currentValue = null;
t = entity.GetType();
properties = t.GetProperties();
foreach (PropertyInfo property in properties)
{
Type a = property.GetType();
if (property.PropertyType.Name.Contains("ReadOnlyCollection"))
{
currentValue = t.InvokeMember(property.Name, BindingFlags.GetProperty, null, entity, new object[0], CultureInfo.CurrentCulture);
}
}
}
I am assuming that I need to return a object and use the generic.MakeGenericType to regenerate the collection type for the object. I have spent more than a day trying without sucesss, anybody done this sort of thing before and have a small sample;), or am what I am doing impossible.
nearly bald
Satvinder
|
|
|
|
|
Have you considered serialization rather than reflecting through your objects?
|
|
|
|
|
Why don't you just serialize it with the BinaryFormatter, SoapFormatter, or XmlSerializer?
:josh:
My WPF Blog[^]
|
|
|
|
|
You can define an interface so you do not have to check for the readonly collection. Then a simple is comparsion will let you know. Also reflection seems unncessary.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Cheers Guys, hadn't thought of that, What is beneifit of using the XMLSerilizer method as against using a Interface.
Satvinder
|
|
|
|
|
I am using the SendKeys class to switch to a browser and enter login details. This works fine in IE, but in Firefox, the letters are each typed twice (e.g. jjoohhnn), and Tab and Enter don't seem to work correctly.
The right window has the focus, because something is being entered, but not correctly, at least not in Firefox.
I use:
SendKeys.Send("john{TAB}doe{ENTER}");
Is this a problem with the code, or might Firefox be at fault?
Can anyone help?
Thanks!
|
|
|
|
|
I've had similar problems with SendKeys; generally it doesn't seem to work too well. I was able to get around some issues by doing different things with Send, SendWait, and adding an Application.DoEvents call after the Send.
In other words, I've found SendKeys to be unreliable. I suggest you look into sending window messages via the Win32 SendMessage API.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
hi all,
my operating system is english. and its date format is mm/dd/yy. but in turkish normal date format is: dd/mm/yy.
i wrote a code which stores some datas.
but if i search for some data in database according to date, it gives errors on computers which has turkish operating system.
the only solution is to change date format of such computers to english(us).
but do i have to do that ?
cant i do any trick so that it makes my program run on any computers (which has english or turkish operating systems )?
help please,
thanks in advance,
bye.
|
|
|
|
|
Use UTC format for dates in the database and searching
|
|
|
|
|
You should try using the current culture to get your date format. When converting a DateTime , you should do it using a particular culture. You can use System.Globalization.CultureInfo.CurrentCulture to determine the culture settings of the computer that the program is running on. Also, when you call Parse on a DateTime , use the IFormatProvider : http://msdn2.microsoft.com/en-us/library/kc8s65zs.aspx[^]
Logifusion[^]
|
|
|
|
|
Hi,
What is the difference between the following two lines?
string strTest = "";
string strTest = @"";
Thanks
|
|
|
|
|
Absolutely nothing. @ is only required to prevent escape characters from being interpreted.
|
|
|
|
|
Using the @ symbol allows you to do this
string strTest = @"C:\Program Files\MyApp";
rather than
string strTest = "C:\\Program Files\\MyApp";
|
|
|
|
|
It also allows you to do this:
string s = @"Well, maybe it's
better if you pick up a book
on C#. You'll get quick answers
on the forum, but they won't
be complete. And, sometimes,
they'll have some ""sarcasm"".";
Logifusion[^]
|
|
|
|
|
|
hi all,when i try to access my application(which contain nearly 1000 records) it raise this error message
"timeout expired.timeout period elapsed prior to completion of the operation or the server is not responding"
i dont know what is this prob and why this is happening...any idea.....?
Regards,
ayyp
-- modified at 9:31 Friday 7th July, 2006
|
|
|
|
|
Ok, you're using .NET remoting or sockets? If you're trying to bring over 1000 records in a single call, chances are it's timing out; it gives up after some period of time.
Instead of trying to bring over all 1000 records in a single call, serialize your records into a stream, then send that stream over byte-by-byte. This will be faster, more performant, and more scalable. You also shouldn't get any timeouts this way provided you don't try to stream too many bytes per call. Try streaming 65000 bytes per call, that's 65k and should work alright on high speed connections.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
sorry,i dont know how to do this can u send any sample code,.......that will help me.........plz.....
Regards,
ayyp
|
|
|
|
|
I have a DataView that contain multiple rows. It has a column say ColumnX that contains values composed of one or more words.
When i pass a multi-word value(one composed of two or more words) to the Find() method of the DataView for search in ColumnX, it just returns me the index of the row where a first word is matched in the ColumnX.
For example:
string searchvalue="Lossy Gray";
int index=dv.Find((object)searchword);
it return index of the row where a match for "Lossy" is found event though thre is row with "Lossy Gray".
I want only index of that row where all words are matched.
Thanks
|
|
|
|
|
How to disable "X" button at the top right of winform ?
Thanks...
|
|
|
|
|