|
|
The LED lights are on but it looks like one ones at home.
"You get that on the big jobs."
|
|
|
|
|
All .NET applications have a built in memory limitation: no single object may exceed 2Gb.
This means that an array of Strings may contain 268, 435, 456 strings (assuming the references are 64 bit).
Your array contains only 12,267,528 elements, but if these are composite objects which take up more than 175 bytes each then they will not fit in a single object.
You could try declaring Block as a Class instead of a Type - that should mean that each element of your array only takes a single reference instead of the whole Block. There will be a performance penalty associated with the extra access - how bad that would be will be down to how you use it.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Which certainly explains why applications you've got running on your 64-bit computer processor, applications which have proclaimed themselves 64-bit despite actually running under a Waring-blender-meld of bittedness, shimmed up by this and that in your own special way in order to run on your toaster, don't actually pop-up any toast that isn't burnt to a crisp.
(Late to the party I suppose ... but hey! There are icons for that now: )
|
|
|
|
|
Are you into reruns of "the best of OG" or something?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
At some point you've got to cast your aspersions upon something unidentifiable and today I was just exercising an old CP trick to see whether I could auspiciously peg the post that caused the ticker on the front page to make that sound ...
Guess I'm not lucky because it wasn't this umteenth page.
|
|
|
|
|
I agree with what OG said. I want to add you should reconsider using a 3D array. In a lot of situations, a multi-dimensional array is not really needed.
Also, do all elements contain meaningful data, or is a majority of them just empty? If a lot are empty, switching from a structure to a reference type is advantageous. And if all or most full, is there a major axis? you may want to consider jagged arrays (e.g. a 1D array of 2D arrays, each with smaller sizes)?
If you need more help, explaining what it is about would be a good start.
|
|
|
|
|
Hello,
Presently I we have a VBA application.
1. We have scheduled tasks using Scheduled Tasks under System Tools.
2. The Schedule task opens a xlsm file and inside the Workbook_Open() method I call some procedures.
For Example:
Private Sub Workbook_Open()
MyMethod()
End Sub
3. The user does not need to interact with the application.
Now the company wants to convert the VBA application to .NET Application. I do not know what kind of application to choose from the following:
1. ASP.WEB Application
2. Windows Application
3. Windows Service Application
4. Console Applications.
Kindly Advice.
Thanks.
|
|
|
|
|
i think that if the user doesn't need to interact with the application, and the work can be scheduled, the better choice would be Windows Service Application, but, if you'll need to be able to start the process by hand at any time, i think console application is more straightforward to you and to the person that will use your application...
what type are your vba application? it's an excell macro?
|
|
|
|
|
What does your company, or your boss, or whoever, think they will gain by converting it ? Is there some functionality that is going to be added ... now, or in the future ... to the existing solution; or is some data or "report" going to be "sent out" or "published" in a way that is not happening now ?
If there are new requirements, I think we can better respond to your scenario if we know what they are.
best, Bill
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
modified 8-Jan-12 5:47am.
|
|
|
|
|
I agree with Bill. "If it ain't broken, don't fix it"
My choice would be to create a service and dump the scheduled task altogether. I can't remember why now but I've had problems with scheduled tasks in the past.
The service could monitor for a given event, time, file added, updated etc.
"You get that on the big jobs."
|
|
|
|
|
How often does it run? If fairly often, then a Windows Service; if not, console.
|
|
|
|
|
hi,
i am working on a USB HID KEYBOARD device. i want to register the device for the notification whenever it gets attached and removed from the system. i want to register it for all windows operating system(for all 32 and 64 bits) starting from XP.
it's a proximity device. User configures the keystrokes from the application provided with the device. As soon as user gets away from the range of the device, the device fires the keystrokes that were configured and saved by the user in the device. The device don't have any keys in it. It just fires the keystrokes configured and saved in it. The device has just the sensor in it.
can anyone provide me the solution how to do register the device?? i am using HID.dll, SETUPAPI.dll and kernel32.dll for this purpose.
|
|
|
|
|
|
using CodeDomProvider, you can compile without running the new code (yielding a CompilerResults), as well as run it without recompiling it (using CompilerResults.CompiledAssembly).
|
|
|
|
|
thank you for your answer.
I know how to create the CompilerResults and how to call a special method of the CompilerResults.
but I want to call a method as if no other method was called before it.
if I call a method of the assembly, for example foo(), which changes a static variable a, i want to call an other method, for example bar(), which is not affected of the change of the value of the static variable a.
do you know, what I mean. sorry for my bad english.
|
|
|
|
|
The statics of a class are executed once, at the first reference to said class. You can't undo that without unloading the class. The whole purpose of statics is to execute once.
And you can't unload a class, the only relevant thing you can unload is an AppDomain. So if you need a fresh class, you could load it in a separate AppDomain, use it, then unload the AppDomain. And again and again.
|
|
|
|
|
thank you very much for your help.
I'm going to try it
|
|
|
|
|
i created a list<string[]> and added data to it
List<string[]> dataArray = new List<string[]>();
dataArray.Add(new string[] { "start", "end" });
dataArray.Add(new string[] { "start2","end2" });
dataArray.Add(new string[] { "start3", "end3" });
now i want to delete the string[] containing {"start2","end2"} how to do it using built in functions like contains,find or by any other methods ?
when i tried following ....
List<String> Key = new List<String> { "start2","end2" };
dataArray.RemoveAll(k => k.Contains(Key));
getting an error :Compiler Error CS0411
The type arguments for method 'method' cannot be inferred from the usage. Try specifying the type arguments explicitly.
can any one help ????
JANARDHAN
|
|
|
|
|
Hi ,
As the elements in the list item are string arrays, you cannot use the contains keyword to compare.
Use the below code,
List<String> Key = new List<String> { "start", "end" };
dataArray.RemoveAll(item => Enumerable.SequenceEqual(item, Key));
Hope this solves the problem.
-Manognya
__________________________________________________
$ God gives what is best.Not what all you wish
|
|
|
|
|
|
Also, item in 'dataArray.RemoveAll(item => Enumerable.SequenceEqual(item, Key));' specified to represent the item in the list and not a variable.
-Manognya
__________________________________________________
$ God gives what is best.Not what all you wish
|
|
|
|
|
+5 Great answer !
best, Bill
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle
|
|
|
|
|
Thanks bill
-Manognya
__________________________________________________
$ God gives what is best.Not what all you wish
|
|
|
|
|
You can't remove using dataArray.Remove(new string[] { "start2","end2" }); as that new array isn't the same as the original one.
However I see three ways, each taking some additional code:
1.
keep a reference to the item you will want to remove later on:
...
string[] toBeDeletedLater=new string[] { "start2","end2" };
dataArray.Add(toBeDeletedLater);
...
dataArray.Remove(toBeDeletedLater);
2.
remember the index in the list, then use RemoveAt()
int toBeDeletedLater=dataArray.Count;
dataArray.Add(new string[] { "start2","end2" });
...
dataArray.RemoveAt(toBeDeletedLater);
This will fail if other list operations cause the indexes to change...
3.
locate the element you want to delete (worst case: iterate and check the content of each element), then call RemoveAt.
|
|
|
|