|
Elena2006 wrote: In Browse dialog I want to restrict File Type as Xls, txt, CSv.
It's not possible with FileUpload control. You can check the file extension and content type after submitting the form.
|
|
|
|
|
What would be the point? A particular extension doesn't guarantee what the contents are.
|
|
|
|
|
I have a tricky problem that I could really use some help on.
My app works with a number of very large float[] arrays that can easily use more memory than is available. To solve this I have created a memory manager that, in cases of dwindling memory, will dump some of the older arrays to temporary files. My app can request a reference to one of these arrays at any time, and the memory manager will recreate the array from the dumped copy if it's no longer in memory.
The problem is that my memory manager must not dump to disk any arrays that are currently being used by other parts of the app because a) any further changes to the array won't be reflected in the dumped copy, and b) dumping an array to disk that is being kept in memory by other parts of the application won't help memory load to begin with since the array won't be collected.
How can my memory manager, when it is deciding which arrays to dump to disk, check to see if other parts of the application are holding references to any of the arrays?
Thank you very much!
|
|
|
|
|
Why don't you use a cooperative approach, making your arrays released by their consumer to your memory manager?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
exactly.
impelment same mechanism as COM object use.
add two methods:
AddReference()
ReleasReference()
and increase, decrease number of it's references in prive variable:
int referenceCount .
When AddReference() is called, referenceCount == 0 and array is dumped to file, recreate the array
When ReleasReference() is called and referenceCount == 1 , dump array to file.
Call AddReference() everytime you need to pass reference to another variable
Call ReleasReference() everytime you dispose this reference
zilo
|
|
|
|
|
(just kidding)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
zilo
|
|
|
|
|
Thank you for the throughtful replies.
An issue is that the app reached a quarter million lines of code and a fair level of complexity before it became clear that temporarily writing these arrays to disk would be necessary. Being able to figure out a way to do this that is transparent to the rest of the app would be a real lifesaver.
|
|
|
|
|
I know it is hard to hear but maybe a bit refactoring is worth. please, don't blame me for
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I don't blame you....but I still might be crying myself to sleep tonight.
|
|
|
|
|
Well good night then and happy new year.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
My first thought upon reading the subject line was, "If it exists, it's being referenced".
Winkles wrote: a quarter million lines of code
What's a line of code?
Anyway, yeah, you need a class that does all that behind the scenes, sounds like a good weekend project.
Or make some type of database? So all the arrays are always cached to disk?
|
|
|
|
|
Could you help me tisth advise how to protect user login and password
i have an open-source applcication which backups data and i want to prevent unauthirized access to file with options programmatically. There is a login and password of a backup user.
so i have no ideas what to use to prevent such information being disclosed or just copied with other people
|
|
|
|
|
|
Hi all
I Wount to add Footer to DataGridView In C#.Net Windows Application
But In Windows Application The DataDridView Dont Have Footer To Add it
I wount to How i can add footer to DataGridView or A new Free Grid Control Have Footer
Thanks For Any Body Help Me
Thaer
modified on Monday, December 31, 2007 2:34:56 AM
|
|
|
|
|
Create a new class, inherit from DataGridView, and override the OnPaint method to display your footer as follows
public override void OnPaint(...) {
base.OnPaint(...);
} Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
How can I apply Model View Conrol (MVC) pattern on windows app, If i were to have only a custom user control class, Data class, and ProperGrid control on a Form1.cs in C#. I have went through couple of MVC patterns on google and here as well, but neither of them telling me how can we update raw data if they were to change by two places, first is through PropertyGrid itself and secondly when the custom control is moved through the mouse.
Please advise me if there is any link i can further learn from. Thanks I appreciate ur favor.
|
|
|
|
|
netJP12L wrote: me how can we update raw data if they were to change by two places
I did this using delegates. So when the data class gets changed, delegate will be invoked and it will change the grid data. I don't know whether this is the real MVC pattern
|
|
|
|
|
Thanks for answering, the way I am trying to implements is also the same way you said. I have a ShapeUserControl that get updated by the dataclass through the delegates. But my problem is how can I update the data class through the ShapeUsercontrol. Can you please show me some demo.
|
|
|
|
|
SharePoint & BizTAlk Server.
Among these two, Which one has better future.
For Employment, which course is better ?
Among these two, which one is easy to learn?
Can any one give your views regarding my question???
G. Satish
|
|
|
|
|
Hi, I have set DataSource for a ComboBox and it works properly but now i want to insert another option ALL, how I could do so? Plz help me out.
|
|
|
|
|
I think there are some properties like Add or Items.Add or Insert in combobox. I think you can use it for adding one more item.
ComboBox.Add("ALL");
|
|
|
|
|
Just use the Add method when you want to insert another item into the combobox.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
after populating your combobox from the database
just use the add method to add another item
|
|
|
|
|
Hello
I am a trainee. In a time column we have intime and outtime. For a particular date their may be more than one swipe but i have to take the first time for that particular day as intime and last swipe as outtime. Could any one help me on this how to proceed.
Ex;
abc 29/12/2007 9.00 (AM)
abc 29/12/2007 9.20
abc 29/12/2007 12.00
abc 29/12/2007 13.00
abc 29/12/2007 14.00
abc 29/12/2007 18.00 (PM)
fd 29/12/2007 18.00 (PM)
fd 29/12/2007 19.20
fd 29/12/2007 21.00
fd 29/12/2007 22.00
fd 29/12/2007 4.00 (AM)
so on..... goes on...
How to take the first time as the intime and the last time as outtime. I want to calculate the total time worked for that particular day by any employee (Card number is also avilable) but NO DATA BASE.
|
|
|
|