|
I looked at Luc's first because it had a 5 vote... and cracked up, ahh I enjoyed that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm just callin' 'em like I see 'em...
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Alas; artificial intelligence is no match for organic stupidity.
"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
|
|
|
|
|
I too giggled the first time I saw this posting and now I am in a similar predicament. I have a client who has had enough of the data entry errors his staff constantly makes while entering chemical names by hand. So we have a combo box with an autofill function, so if they type 'Alc' the combobox will display all records that start with 'Alc'.
There are 3 of these combo boxes each one with over 25,000 items. The page takes 4 seconds in loading. The client is happy, I of course i'm not.
|
|
|
|
|
sudhir behera wrote: please help me how will make it faster
By loading a lot less data.
"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
|
|
|
|
|
Try using a System.Terror to load the datas.
OK, really bad design. You should let the user search or at least provide some sort of paging or...
- But, as a small improvement to whatever you have, you could unbind the combo,
get all the datas in a array of strings using a datareader then use the Items.AddRange();
- also wraping the whole filling of the combo in a
"comboBox1.BeginUpdate(); ... comboBox1.EndUpdate); " should help a little.
Again, bad design.
But still 45 secs seems way to much for 134000 strings/records.
|
|
|
|
|
Hi . I have xml file .
XmlWriter writer = XmlWriter.Create(path + "\\playbackmanu.xml");
writer.WriteStartDocument();
writer.WriteStartElement("PlayBack");
for(int i=1;i<=nCount;i++)
{
writer.WriteStartElement("ItemInfo");
writer.WriteElementString("itemimgpath","img"+ i.ToString() + ".jpg");
writer.WriteElementString("itemname", "");
writer.WriteElementString("itemtitle", "Title "+i.ToString());
writer.WriteElementString("itemcommand",i.ToString());
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();
------------------------------------------------------------
#PlayBack#
#ItemInfo#
#itemimgpath#img1.jpg#/itemimgpath#
#itemname##/itemname#
#itemtitle#Title 1#/itemtitle#
#itemcommand#1#/itemcommand#
#/ItemInfo#
#ItemInfo#
#itemimgpath#img2.jpg#/itemimgpath#
#itemname##/itemname#
#itemtitle#Title 2#/itemtitle#
#itemcommand#2#/itemcommand#
#/ItemInfo#
#/PlayBack#
# is < and >
--------------------------------------------------------------
How i can add atribute first node ?
#PlayBack testAtribute="Hello world"#
Thanks.
We are haven't bug,just temporarily undecided problems.
modified on Wednesday, April 14, 2010 6:24 AM
|
|
|
|
|
Just after writer.WriteStartElement("PlayBack");
writer.WriteAttributeString("testAtribute", "Hello world");
Good luck
|
|
|
|
|
|
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Thanks
Nematjon Rahmanov wrote: We are haven't bug,just temporarily undecided problems
It's not a bug, it's a feature!!!
FTFY
I hate signatures, but I love 5's
|
|
|
|
|
FYI you can use < (<) and > (>) in your posts instead of #
That would make it a bit clearer IMO
|
|
|
|
|
Hi,
I am currently using bing maps. There is one text box and a search button which will find the location on bing maps.
I have already done with that, it is finding the location properly, when i enter the location/address in textbox and click on the search button.But, i want to mark that location using polygon shape.
It means when i enter the address in textbox and hit the search button it will find the desired location and mark that area in polygon or circle shape.
How can i achieve that. Can any one provide me some code or some useful link which can help me out.
regards,
Pranav dave.
Pranav Dave
|
|
|
|
|
I friends, I made a simple program that use Drag&Drop event.
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
String str = (String)e.Data.GetData(DataFormats.StringFormat);
textBox1.Text = str;
}
When i run the program under windows7 the Drag&Drop event doesn't function, but the same program under WindowsXP, function.
Could anyone explain why there is this problem?
Thank you.
Bye Bye
|
|
|
|
|
Some more detail is required.
Where are you dragging the text from?
Does the dragenter event fire?
Is the data in the e.Data.GetData?
Is there an error generated?
Have you set allowdrop on the textbox?
Have you stepped through the code to see what is not happening?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for reply.
I drug a txt file over the textbox, the allowdrop property in set.
The code is ok, becouse 10 minutes ago i tried to rum my application, with only exe file not under debug in Visual Studio, and everything is ok.
Now, why under source-code the drug&drop doesn't function but if i run the application from exe file everything is ok?
Thank you!
Bye
|
|
|
|
|
I'd be VERY worried about dragging a file from explorer into a text box, you are hoping explorer behaves the same for both XP and weven. One is probably dropping the filename into the text box and the other is tyring to drop the file object into the text box.
Inspect the content of what is dropped to determine what has arrived.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi.
I'd like to have access to the bytecode that is currently running or about to run in order to detect certain instructions and take specific actions (depending the instructions). In short, I'd like to monitor the bytecode in order to add safety control (see DETAILS below for explanation).
Is this possible? I know there are some AOP frameworks that notify you of specific events, like an access to a field or the invocation of a method, but I'd like to skip that extra layer and just look at all the bytecode myself, throughout the entire execution of the application.
I've already looked at several AOP frameworks (although not in great detail, since they don't seem to do quite what I need) and I'm familiar with Mono.Cecil.
I appreciate alternative suggestions, but I don't want to introduce the overhead of an AOP framework when what I actually need is access to the bytecode, without all the stuff they add on top to make it more user-friendly (... admittedly very useful stuff when you don't want to go low-level).
Thanks
DETAILS:
Basically, I have a C# application and I need to monitor the instructions it wants to run in order to detect read or write operations to fields (operations Ldfld and Stfld) and insert some instructions before the read/write takes place: I may need to acquire locks, or if that fails abort the operation. Also, I may need to update a read log (in case of a read) or write log (in case of a write).
In fact, what I'd really like to do is to replace the read/write instruction with my own custom code, but it that fails I think I could manage just inserting some instructions before and after.
|
|
|
|
|
Would a simple property do what you want?
Maybe even write a class to hold the affected fields.
|
|
|
|
|
I'm afraid not: I need to be able to detect accesses to any data, including fields of sealed classes which I cannot redefine as properties.
As for your second suggestion, if the field is of a sealed class I won't be able to write a wrapper that extends it. For example if I have:
class SomeClass {
SomeSealedClass fieldIWantToProtect;
}
sealed class SomeSealedClass {
...
}
I cannot write a class:
class SomeSealedClassWrapper : SomeSealedClass {
}
Thanks for your answer.
|
|
|
|
|
I was thinking more along the lines of:
private class ProtectiveLayer
{
private SomeSealedClass afield ;
public SomeSealedClass Afield { ... } ;
}
public class SomeClass
{
private ProtectiveLayer blah ;
public SomeSealedClass Afield
{
get { return ( blah.Afield ) ; }
set { blah.Afield = value ; }
}
}
But, I think you should explain more about why you want to do this; it doesn't sound worthwhile.
|
|
|
|
|
Again, I cannot do that, because SomeClass may be sealed and I won't be able to override it in order to introduce the property.
PIEBALDconsult wrote: But, I think you should explain more about why you want to do this; it doesn't sound worthwhile.
I explained it in the DETAILS section of my first post. I don't know what else to say; if you have any specific question I'd be happy to answer it.
The key here is that I don't just want to control access to specific fields of a specific class, but every field of every class, including library classes. This is because I need to log those changes in order to be able to undo them if necessary.
I know this seems pretty brutal but it's what my system is all about: protecting the data.
|
|
|
|
|
blackblizzard wrote: including library classes
Ah, classes you didn't write, I see.
blackblizzard wrote: undo them if necessary.
That's probably not a good idea, but maybe someone can figure it out.
|
|
|
|
|
PIEBALDconsult wrote: Ah, classes you didn't write, I see.
Yep.
PIEBALDconsult wrote: That's probably not a good idea, but maybe someone can figure it out.
What isn't a good idea? If you mean the undo, it's a very important requirement of the system, and it's completely necessary. There are transactions running in the system, and if they fail I need to roll them back (undo what they've done). It's pretty standard, and I've seen it done at a higher level in Java, but the way they do it isn't possible in the .NET framework.
EDIT: I should clarify something about the "undo": it's not that you let the transaction write whatever it wants to memory and then with the undo change it back to how it was. Rather, when the transaction wants to write to a field I intercept the write and write to the transaction's write log instead (write, write, write). If the transaction commits (i.e., finishes successfully) I dump the contents of the write log to memory (actually perform the write it requested). Otherwise, if it rolls back, I simply discard the contents of the write log and they're never written to shared memory.
In any case I need to be able to monitor all accesses in order to register them and redirect them to the write log, if necessary.
|
|
|
|
|
I would use Mono.Cecil to modify the binaries on disk.
Ideally you'd add a reference to a helper assembly, and use Cecil only to replace the ldfld/stfld instructions with calls to a method in your helper assembly (passing the field by-ref and/or as metadata token).
However, there's another option for bytecode modification that's not well-known: the .NET profiler API.
Using the profiler API, you can register a hook that will be called by the .NET framework to modify the IL bytecode immediately before it's JIT-compiled.
This way you can also instrument code that's dynamically loaded (Reflection.Emit). But it's much harder to use than Cecil because any changes to metadata (e.g. adding a reference to one of your methods) have to be registered with the running .NET instance, and there are some limitations on what metadata you're allowed to change at run-time.
Are you trying to implement software transactional memory for .NET? Even using the powerful profiler API, you'll likely run into limitations (e.g. when .NET calls into native code), not to mention performance problems.
|
|
|
|