|
-The issue is that this application uses xml files which contain all binary wave and image data... which is where the mChildNode comes from. Management is requiring the use of a single xml file that contains all the data.
-Is there a faster, more performant way of grabbing these images from the xml file. Is it possible to convert the xml node value to several smaller strings and then combine them later on?
|
|
|
|
|
What is the size of a single wave/image?
Are you sure you want all the waves/images at the same time? You can't display them
all at once, can you? How about using thumbnails (best also stored in the same XML file)?
If your individual objects are huge, then there are for sure ways to get at them
even under memory constraints, and faster than in a straightforward manner;
my approach would consist of:
- storing smaller parts of the image instead of the whole thing, even in the XML file;
- retrieving the data using multiple threads, into a huge bitmap that got pinned down,
making say 4 threads each responsible for a quarter of the bitmap.
You might want to reveal more of the context...
|
|
|
|
|
Yes, the application could potentially display an unlimited number of images at the same time. The size of each image is possibly around 200*200 could be less and could be more.
I am already using threads to parse the xml file concurrently. My xml parser is recursive...
The only issue is the remaining byte arrays that have a large impact on a mobile device that is also being targeted.
|
|
|
|
|
OK,
Justin Time wrote: on a mobile device that is also being targeted.
that is new information.
Justin Time wrote: The size of each image is possibly around 200*200
That is not what I call a large image. It would take less than 200KB.
Justin Time wrote: Yes, the application could potentially display an unlimited number of images at the same time.
So it is a server with an unlimited number of clients? or a client with an unlimited
screen?
I am performing some memory tests on a Vista laptop.
So far it confirms the large heap theory, the 80KB threshold, and the risk for
fragmentation.
Preliminary recommendation: try to keep your objects smaller than 80KB, as much
as possible.
There may be article material in here.
More research is needed tho.
I don't have a CF device available, and have never accessed one, so I have
no idea how much worse it might be.
|
|
|
|
|
Images are resized to fit the screen... = unlimited (marketing).
So essentially this is a hope and pray game? Hope that the gc on the device would collect the unused byte arrays?
|
|
|
|
|
In the mean time I have read a dozen articles on the subject.
This is my conclusion:
1) objects smaller than 80KB will pose no problems if handled correctly.
2) objects larger than 80KB are allocated in LOH (Large Object Heap) which is
susceptible to fragmentation since there is no compaction for it; there are some
guidelines to reduce the likelyhood (i.e. postpone the unfortunate situation), see e.g.
Nish's article[^].
My advice is avoid unnecessary large objects (i.e. >80KB), so don't turn an image
into a byte[] or a string that exceeds that threshold.
BTW In software hope and pray is not a viable strategy.
|
|
|
|
|
Luc Pattyn wrote: BTW In software hope and pray is not a viable strategy
I've been looking for a signature for ages! Hope you don't mind
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
|
I forgot to mention:
multithreading, i.e. having multiple threads that generate images out of XML is a
very bad idea as long as your generation process produces large objects that
are permanent (the images themselves), AND large objects that are not permanent
(the base64 strings and the byte arrays).
So you really should:
- either have simple code, with large objects, and a single thread;
- or elaborate code, avoiding all intermediate large objects, and only then is
multithreading a good idea.
|
|
|
|
|
Justin Time wrote: mImage = new Bitmap(stream);
So what happens to the previous Bitmap instance? You need to dispose of it, if you can.
|
|
|
|
|
It is already being disposed before hand.
|
|
|
|
|
Hi All...can any1 tell me if there is a way to disable or hide all the IE7's menubars and statusbars and how can i how do i do it?
Thnks in advance
living life on the flip side
|
|
|
|
|
You can use the javascript method window.open to open a browser window, and the options you pass to it define what is visible in the browser window.
|
|
|
|
|
Hi Pete...thnks for the reply but i dont understand....wat options do i define....menubar.visible = "False" or how will i do it?
i dont no the options in other words!
living life on the flip side
|
|
|
|
|
Kiosk mode[^]?
Or write an app whose only control is a WebBrowser?
|
|
|
|
|
say there's a server program lauch in a LAN network and it is listening at port number 2000.
1. Anyone has an idea on how to obtained the ip address for the above mentioned server?
2. Or is it possible to communicate to this port with the condition that ip address for the above server was not given. Hacker pls help
|
|
|
|
|
You definately need the IP (or hostname) of the server in order to connect to it. That would be like someone sending you an email without your email address! If you don't know the IP you could do an ip scan on your network to find any ip's with port 2000 open.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
1. You must find it manually. It likes "find house number 2000", but in which city ? which street ?
2. Read first, how TCPIP works. You cannot connect to server if you don't know the IP address.
|
|
|
|
|
You asked this question yesterday and got the same answers.
You can't do it. You only option is to enumerate all the IP address on the network and ping them to test if the port is open.
As several people have said, it's like asking where to find house number 103 but without telling them which road it's on.
Simon
|
|
|
|
|
again,
1) you need to know the server ip in order to connect to it.
2) do you want to know if it´s possible for you as a client to connect to a server without giving your ip? no
When the designed application on the server asks the client´s ip when he tries to connect, if the server can´t get it, he doesn´t grant acess to the client. i woulnd´t!!!
Do you want to make a fake ip, be somewhat stealth mode? is that it? i don´t how to do that but, i think you can find something of that to download.
|
|
|
|
|
simple solution would be ...search the IP with in the LAN and match its port number.
Sr. Software Engineer
Irevna, India
|
|
|
|
|
scan the your Lan ip's using dos command " net view" it would give all machine names and then from that machine names get their corresponding ip's.
then combine ipaddress and the port u want to scan, thru this code
for (int CurrPort = 1; CurrPort <= 25; CurrPort++)
{
TcpClient TcpScan = new TcpClient();
try
{
// Try to connect
TcpScan.Connect("192.168.0.1", CurrPort);
// If there's no exception, we can say the port is open
MessageBox.Show("Port " + CurrPort + " open");
}
catch
{
// An exception occured, thus the port is probably closed
MessageBox.Show("Port " + CurrPort + " closed");
}
}
|
|
|
|
|
Hi,
I am trying to run the following code in a dynamically loaded WCF service hosted in a Windows Service.
It seems I can't load types because of the following exception:
Could not load file or assembly 'APLUGINASSEMBLY, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ddd7975916a1e051' or one of its dependencies. The system cannot find the file specified.
Here is the list of the referenced assemblies:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Viveo.Data, Version=1.4.0.0, Culture=neutral, PublicKeyToken=ddd7975916a1e051
NavigationProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullSystem.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Please note that the very same code works fine when I run the WCF Service from Visual Studio.
Thanks.
protected static void AnalysePlugins(Assembly[] Assemblies)
{
foreach (Assembly anAssembly in Assemblies)
{
try
{
foreach (Type aType in anAssembly.GetExportedTypes())
{
try
{
if (aType.GetInterface("ANINTERFACE") != null)
{
string theNavigationName = (string)aType.InvokeMember("Name", BindingFlags.GetProperty, null, aType.GetConstructor(new Type[]{}).Invoke(new object[]{}), null);
NavigationRepository[theNavigationName] = aType;
PluginRepository[aType] = anAssembly;
}
}
catch(Exception ex)
{
Trace.WriteLine(aType + " could not have its name queried");
}
}
}
catch (Exception ex)
{
System.Diagnostics.EventLog.WriteEntry("BusinessServer", ex.Message);
System.Diagnostics.EventLog.WriteEntry("BusinessServer", string.Concat(anAssembly.GetReferencedAssemblies()));
}
}
}
|
|
|
|
|
I found out!
It works when I load the assemblies using LoadFrom instead of LoadFile (it is in a function that I have not provided).
|
|
|
|
|
In my project there is a facility for user to upload images and update them later.A visitor to the site can view the users images.What I want to do is that I want to display all the images with equal dimensions.That means if the user uploads image of any size it should be displayed say as 100 X 100 without change in its quality(Resolution, aspect ratio etc.)
Any help would be highly appreciated.Thanks
|
|
|
|