|
Well, I don't wish to argue on this.
Apology, i could not convey my issue properly.
As already mentioned, my issue is disk space.
I can compensate on time consumed, this time, to some extent.
As someone suggested, I liked the database approach as it should take lesser space as well as it will be faster.
Thanks Anyways.
|
|
|
|
|
When disk space is your primary concern:
- I don't see how a database would be more compact than plain text files;
- compression is what you want, ZIP is very good at compressing text (however it takes lots of cycles to decompress).
If you find anything significantly better than ZIP I will be very interested!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Ok, for the time being I will keep the zip aproach only.
I will let you know, in case, i will get better approach.
Thanks for all your help Luc.
|
|
|
|
|
I have to agree with Luc.
ZIP is probably the smallest you will practically get it (or RAR - I won't argue).
A database will quite likely increase the space taken up, as it stores all sorts of extra information over and above your text (table definitions, row ids, etc.).
However, a database may improve the raw disk space usage compared to a lot of separate files, depending on your HDD format. In some formats, a file must occupy complete clusters, so a lot of files mean a lot of partially empty clusters. This is not the case with database or zip.
MySQL does support a COMPRESS function that shrinks a text string, I don't think MsSql does (I could be wrong). However, it required a ZIP library to be loaded so it won't save you anything over using ZIP directly!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
zipping seems to be a good idea.
without knowing anything about the content/structure of your textfiles, its not possible to say more.
I cannot remember: What did I before google?
|
|
|
|
|
Hi,
Thanks for your response.
Each file is a list of string which needs to be parsed by the application.
Those string will essentially contain ASCII chars only. UTF-8 only.
|
|
|
|
|
strings -> zip -> optimal.
if you provide sample data, maybe we can found something else.
I cannot remember: What did I before google?
|
|
|
|
|
As mentioned before, if you can extract the data to a database, that would be the best, most flexible solution.
If the string data is predominately numeric you could convert the numeric data to a numeric datatype and then store the file as a binary file. A binary representation of a number is typically a chunk smaller than the string representation of the same number.
"You get that on the big jobs."
|
|
|
|
|
Hi,
I am creating Download manager application which requires pause and resuem capability. I am working on C# application. Can anyone suggest me way(s) for requming cancled or pause downloading file.
Happy Programming
|
|
|
|
|
Going through this[^] article might help you out.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Hi Pranit this Link[^] might help you.
|
|
|
|
|
Hello,
I VC++/MFC developer and new to C#. I wanted to know how I detect portable device attached to my PC. And how to distinguish them like pen drive, iPhone, iPod etc.
Thanks in advance.
|
|
|
|
|
Today I accidentally stumbled upon this page in the MSDN Documentation:
ContextStaticAttribute[^]
What the hell is a context? How do I create one or change the current context, etc...?!?
Somewhere on the intertube I found it seems to be different for each query in an ASP.NET app, how about remoting / WCF? I guess it is but it's fuzzy, and not well defined in my mind....
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
In .NET a context appears to me to be a little schizophrenic. They pop up all over the place and seem to represent something slightly different each time. I guess it depends on the context.
I'm not sure if it represents what you have found but this[^] page, also from MSDN, has the clearest explanation I have seen.
Hope it helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Good find hey, thanks!
BTW, I liked your pun!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi guys,
I am able to access my own outlook calendar but i wanted to know how could I access the shared calendar via C#.
The shared Calendar resides in the Outlook Public Folders. I couldn't find any examples
Could you please help me.
Thanks
|
|
|
|
|
This[^] thread has a solution using Office.Interop.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Hi there all !
In my windows form application i add a tollstrip and 4 buttons on it. I also add 4 panels on form on Dock property: Fill. Mayby it's lame question but I want to modify some of this 4 panels and i go in properties and check for example Panel2 - the list of properties of this control is available but on form i still see a panel1, how i can see my panel2, or 3? I just want to add to this panels some buttons etc...
best regards
|
|
|
|
|
If you add several Controls to a Form and give them all DockStyle.Fill, they will overlap and only one at a time will be visible. What you can do is this:
- in Visual Designer click/select one of the Controls or the Form itself;
- now open the properties pane, it will show the properties for that control;
- on the top it also has a ComboBox listing all the Controls of the Form; select the one you want, I expect that suffices to make it visible.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Luc Pattyn wrote: I expect that suffices to make it visible.
Unfortunately not. You have to play silly beggars with the "Bring to front" / "Send to back" buttons to do anything useful (like drop controls on them).
Certainly this is the case in VS2008 - I haven't tried it in VS2010.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Tried it in VS2008, and you're right.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Nope: it doesn't work like that. When you select "Dock...Fill" the panel covers the entire client area, and will re-size itself to make sure it always does.
If you have multiple controls that are all set to Fill, then tehy are all teh same size, and stacked behind each other. The only way to see them at run time is to make three of them Visible=False and one of them Visible=True
At Design time, they are also stacked up, only you can't make them invisible. The only way I know to select a specific panel is to use the drop down list at the top of the Properties window. Even that won't let you select panel1 and drop controls on it if panel 2 is on top of it. To do that, you will have to select a panel, use the "send to back" button, select a different panel, "send to back" and repeat until you have the panel you wanted.
An easier (and nicer for the user) approach might be to use a TabControl instead, and put each of the panels on separate tabs.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Thanks for help i did a similar but i take 3 panels and set to dock: fill and I made sure that's not any one panel is child of the other panel... So i set all panels are on Form1. Then if i want to modify some panel i used Format -> Order -> Bring to front then i have access to a panel which i want to modify...
I also type those 3 panels on
visible = false
and
private void toolStripSplitButton2_ButtonClick(object sender, EventArgs e)
{
panel2.Visible = false;
panel3.Visible = false;
panel1.Visible = true;
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
panel2.Visible = true;
panel1.Visible = false;
panel3.Visible = false;
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
panel3.Visible = true;
panel1.Visible = false;
panel2.Visible = false;
}
so it's that good in code? Or should i some change?
|
|
|
|
|
It's clear enough! I would be tempted to have a generic routine which sets them all invisible and then set only the one I want visible though:
private void toolStripSplitButton2_ButtonClick(object sender, EventArgs e)
{
SetVisible(panel1);
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
SetVisible(panel2);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
SetVisible(panel3);
}
private void SetVisible(Panel p)
{
panel1.Visible = false;
panel2.Visible = false;
panel3.Visible = false;
p.Visible = true;
}
For just three panels, I would be happy enough with that: to go any higher, I would use a loop instead:
private void SetVisible(Panel p)
{
foreach (Control c in Controls)
{
Panel pan = c as Panel;
if (pan != null)
{
pan.Visible = false;
}
}
p.Visible = true;
}
Oh, and I would get rid off your names! Don't use "panel1", "panel2", "tool_stripButton2" etc.: use names that describe what they contain. "panColors" and "panFonts", "tsbSelectColors" and "tsbSelectFonts" help the readability of your code a lot, and that makes it easier to debug and work with.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
ok i rename it all and put thise code :
private void toolStripSplitButton2_ButtonClick(object sender, EventArgs e)
{
SetVisible(panel1);
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
SetVisible(panel2);
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
SetVisible(panel3);
}
private void SetVisible(Panel p)
{
foreach (Control c in Controls)
{
Panel pan = c as Panel;
if (pan != null)
{
pan.Visible = false;
}
}
p.Visible = true;
}
it's more beauty of code... than set all false/true without the intended purpose if the panels will...
P.S It's really uncomfortable to switch between all panels "bring to front"
thx for help !!
|
|
|
|