|
MrEyes wrote:
Storing data as string is, I believe unavoidable otherwise it would not be possible to search data. However the design has alot of repeated data in some fields, I believe that normalising the varchars would give a significant performance enhancement. Or as you suggested using text indexing
I don't know SNMP enough to be sure of what I'm saying without looking at the data, but some fields feel like they deserve a separate table:
Packet Type -> Maybe a packet type table?
OID -> Is it something like a MAC Address or a unique object ID? If so, you should have an "object" table.
snmp_version -> this seems like an attribute of the "object" table, as it seems 1x1 related to OID.
Source IP and Community Name -> Aren't those somehow related to OID too?
Source IP -> You can (and maybe should) store IPs as INTs[^].
Timestamp -> This is a count of seconds since some arbitrary point on time. You could use a numeric field to store that, it'll be way smaller.
This may make your database way faster to search, as it will be much smaller, and you'll only need to search smaller varchar tables (maybe hundreds or thousands of records) before going to the main table (captured_traps). But logging it may be a bit slower, only a test may say...
I don't see dead pixels anymore...
Yes, even I am blogging now!
|
|
|
|
|
I make with the pen tools of my application some drawing operation (g.DrawImage...) then i call picturebox.Invalidate() but it is very slow.
How can i make it faster? I've tried also this:
SetStyle(ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);
|
|
|
|
|
I would like to create crystal reports dynamically - i.e. add fields to the report at runtime. Thanks to anyone who can point me in the right direction.
|
|
|
|
|
hello,
I've been on this problem for a while. I'm working on a windows form that has a datagrid control. lets say the user enters a value that is more that the specific length. I was able to truncate the value but my problem is I'm not sure how to put it back. Please advise. thanks!
private void TextBox_TextChanged(object sender, EventArgs e)
{
TextBox t = (TextBox) sender;
string val = t.Text;
int len=0, offset=0;
DataGridCell dgCell = this.dataGrid1.CurrentCell;
string sElementGroupID = dataGrid1[dataGrid1.CurrentCell.RowNumber, 0 ].ToString();
Al3UpdateFile objCell = new Al3UpdateFile(file_stream);
objCell.GetGroupElementValues(sElementGroupID, ref offset, ref len);
if(val.Length > len)
{
if(MessageBox.Show("Data Entered is longer than its allowed.Data will be truncated.","XDAL3Reader",MessageBoxButtons.OK,MessageBoxIcon.Information) == DialogResult.OK)
{
orignalText = val.Substring(0,len);
dataGrid1[dgCell] = orignalText;
}
}
else
{
return;
}
-- modified at 18:26 Wednesday 5th July, 2006
|
|
|
|
|
Hi!
I would like to make a program which will simulate some kind of shared folder.
So I can mount it and have "virtual drive".
Could some one give me some starting hint.
One is to study network file sharing protocol and than simulate that, but I hope there is some easier way.
For having a virtual drive I already look for "shell namespace extensions" in c++ & MFC but that just ain't that.
..:: Life Is Like A Box Of Ammo ::..
|
|
|
|
|
Hi. I am looking for a way to create a game trainer in C#.NET. That is to access the memory of a certain process (i.e. the game) and to modify some variables. I tried to use the Process class, but it is limited and has many security restrictions... I would even be happy to find a solution for this problem in C++...
Thanks in advance.
bunny EATING rabbit
|
|
|
|
|
|
Thanks a bunch man !! It was really helpfull !! I did it :> (next time i'll look harder )
bunny EATING rabbit
|
|
|
|
|
I have a class of UserControls all of which need to implement the same method.
I can achieve this with an abstract method
public abstract void foo();
However this has a disadvantage:
(A) There is some commonality in the code that it would make sense to extract and put into the base class.
I know that I can achieve this by
//Base
public virtual void foo
(
BaseCode();
)
//Derived
public override void foo
(
SomeCode();
base.foo();
)
But then that gives me 2 disadvantages
(B) It doesn't force a derived class to do it's own implementation of foo
(C) if the derived class doesn't explicitly call base.foo(); my common code doesn't get called.
Is there some other modifier or pattern I can use to achieve A, B, and C?
Or. Is there a good reason why I should not be trying to achieve this?
|
|
|
|
|
You can try splitting it up into three methods. One method has your base code. The other method is abstract and must be overridden by subclasses. And the last method calls the base code method first, then the abstract method.
Logifusion[^]
|
|
|
|
|
A, B:
If the method that you put in the base class doesn't fully implement what the method should do, you shouldn't implement it at all. Make it abstract, and put the code in a protected method that the derived classes can use to implement the abstract method.
C:
You can't force anything about how an overridden method is implemented. If you want some code to always be called from the method, let the derived class implement another method instead, that is used by that method:
Base class:
public void Foo() {<br />
FooTask();<br />
SomeOtherCode();<br />
}<br />
<br />
protected abstract void FooTask();
Derived class:
protected override void FooTask() {<br />
SpecificImplementation();<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
How do I convert an Image to a memory stream ? or better yet a byte[]? I've tried
Image tmp = ...
MemoryStream ms=new MemoryStream();
picLastSent.Image.Save(ms, ImageFormat.Jpeg);
But I keep getting a generic GDI+ exception.
I need it in byte[] format to send it out on a UDP multicast socket.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
hope it is helpful
sender:
MemoryStream ms = new MemoryStream();<br />
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
ms.Flush();<br />
Byte[] photo = ms.GetBuffer();
receiver(displayed by a picturebox control):
<br />
pictureBox1.Image=Image.FromStream(ms,false);
|
|
|
|
|
Nope it creahes on the Image.save call with a Generic GDI+ Exception.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
|
|
Hello,
I have 2 forms that i need to show the respective version in a dialog box or in another form.
something like this:
form1 version: 1.0.0.0
form2 version: 1.0.0.1
Cpyright..........
Im thinking to put in a class so that's any new form can use it.
Any idea?
Donkaiser
|
|
|
|
|
Hi!
You can access the version of the assembly your classes are in, but there is no way built in to have different versions for different types in the same assembly.
Take a look at the Assembly.GetName() method and the AssemblyName.Version property.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I am using the WebBrowser Control in my application and I need to somehow access the HTTP headers of the HTTP Request in order to obtain a cookie that is passed from the browser to the server during the submit. The cookie is a temporary one, it is not possible to access it on the file system because it doesn't get saved to a file.
Many thanks to anyone that can help,
Michael
|
|
|
|
|
Go through the DHTML interface to access the cookie.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
I'm trying to access the cookies found in the HTTP Request, I believe that what can be accessed through the DOM are the cookies that get returned in the Response. Any ideas?
Thanks,
Michael
|
|
|
|
|
They are the same. Whatever is in the browser cookie is what the browser sends in the HTTP header.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hello People, may be you can help me with this:
I've a winform with FormBorderStyle.None, and I want to set a background image. I want to use the image size as the winform size.
The problem is when I run the example, the size of the form is bigger than the image size, so I see a part of the winform with the background color.
Here is the code:
public FrmOne()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.Manual;
this.BackgroundImage = global::Project1.Properties.Resources.img_1;
this.Size = this.BackgroundImage.Size; // not work
//this.ClientSize = this.BackgroundImage.Size; // not work
this.StartPosition = FormStartPosition.CenterScreen;
//int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width ;
//int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height ;
//this.Location = new Point(x, y);
this.tmrTimer.Start();
}
Any ideas? Thanks a lot !!!
|
|
|
|
|