|
Hi,
if you don't have a question, and just want to share your solution to compensate for the absence of a SerialPort.RingIndicator property, maybe you should post your approach as a tip. See here[^].
|
|
|
|
|
Hello,
I'm developing a application which sends and receives tons of data over UDP. I know the problem of UDP to loss udp-datagrams between sending and receiving. So i created a stack and a timer, where the datagrams to send are stored and sended. (All datagrams get a counting ID, so i'm able to recognize if something is missing)
With the interval of the timer i'm able to control the transfer-rate. My problem is now, how to calculate the correct interval of the transfer? Is there any logic to do this? I would work with the messages i get from the connection-partner how many datagrams are lost, but what is the best way to calculate this?
|
|
|
|
|
If delivery is important, why are you even using UDP?
UDP does not guarantee delivery, and considerbly less known, does not guarantee that the packets will arrive in the correct order.
This sounds very kludgy because you cannot guarantee that the interval will be constant, depending on network traffic and load on the client end, the server end, and everything in between. Remember, it's not just your app putting data on the wire and it's a shared medium being used by machines that have nothing to do with your app.
softwarejaeger wrote: My problem is now, how to calculate the correct interval of the transfer?
What defines what the correct interval should be? Just because a packet was lost is not a valid indicator that the transfer should slow down. The NIC will only send out packets when it can, not at the rate your app can send them.
|
|
|
|
|
Hi, Everybody
i am writing ANN code with c#
i wrote a class which has folowing structure;
<br />
<br />
class neuron<br />
{<br />
public double [] dentw = new double[nron];<br />
public double bias,hata,delta ;<br />
<br />
public double[] input = new double[nron ];<br />
public double output ;<br />
public int[] sbaglanti = new int[nron];<br />
public int[] sbagk = new int[nron];<br />
public int[] obaglanti = new int[nron];<br />
public int numara;<br />
public int dents;
public int oid,sid;<br />
<br />
~neuron() { }<br />
<br />
}<br />
class layer {<br />
public neuron[] noron = new neuron[nron];<br />
<br />
public layer()<br />
{<br />
for (int index = 0; index < noron.Length; index++)<br />
{<br />
noron[index] = new neuron();<br />
}<br />
<br />
}<br />
<br />
~layer(){}<br />
<br />
}<br />
class net {<br />
<br />
public int ban, hen;<br />
public layer[] layers = new layer[lay];<br />
public net()<br />
{<br />
for (int index = 0; index < layers.Length; index++)<br />
{<br />
layers[index] = new layer();<br />
<br />
}<br />
<br />
}<br />
<br />
~net(){}<br />
<br />
}<br />
<br />
net networks;<br />
<br />
in here, i want to change neuron count of layers and so how can i do it ?
can you help me ?
thanks
|
|
|
|
|
Just change the value of nron.
|
|
|
|
|
i want to difference neuron in diffrence layers it means firs layer which has 4 neurons and second layer 7 neurons ...
|
|
|
|
|
Make a Layer constructor with an int parameter giving the Layer's length. Then in class net, pass the length you want when you make a new Layer.
Take the initialization of noron out of class Layer, and allocate this array in the Layer constructor with the proper length.
|
|
|
|
|
You also need to make some changes to class neuron so that the arrays of weights to the previous and following layers have matching lengths.
|
|
|
|
|
Firstly I hope that your knowledge of Neural Networks is greater than your knowledge of programming, otherwise I fear that this particular project is going to be beyond your capabilities.
Still, let's get on with a little help:
The first thing that I would do is to change your net class, something like this
class net {
public int ban, hen;
public layer[] layers;
public net()
{
layers = new layer[lay];
for (int index = 0; index < layers.Length; index++)
{
layers[index] = new layer();
}
}
public net(int lays)
{
layers = new layer[lays];
for (int index = 0; index < layers.Length; index++)
{
layers[index] = new layer();
}
}
~net(){}
}
You will see that I suggest moving the instantiation of your layer[] to within the constructor. I have also added a constructor that takes an int as a parameter. With the class defined in this way:
net networks = new net(); gets you a network with the standard number of layers (whatever you have set your lay member to)
net networks = new net(25); gets you a network with 25 layers.
For your actual question I would suggest that one method would be to add yet another constructor to the net class and one in the layer class.
Firstly, layer gets the same treatment as above, for the same reason.
public neuron[] noron;
public layer()
{
noron = new neuron[nron];
for (int index = 0; index < noron.Length; index++)
{
noron[index] = new neuron();
}
}
public layer(int neurons)
{
noron = new neuron[neurons];
for (int index = 0; index < noron.Length; index++)
{
noron[index] = new neuron();
}
}
I have just listed the new constructors.
In the net class the new constructor would look something like:
public net(int lays, int[] neuronMap)
{
if (neurons.Length != lays)
{
throw new ArgumentException("neurons");
}
layers = new layer[lays];
for (int index = 0; index < layers.Length; index++)
{
layers[index] = new layer(neuronMap[index]);
}
}
~net(){}
}
Using the suggestions above you could then do something like:
int[] neuronMap = new int[] { 6, 7, 8, 9, 10 };
net networks = new net(5, neuronMap);
This creates a net with 5 layers . The first layer will have 6 neurons, the second 7 and so on.
I hope this 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.”
|
|
|
|
|
Why do you have a destructor? An empty one even. It doesn't even do anything, except slow you down.
Empty destructors should not be used. When a class contains a destructor, an entry is created in the Finalize queue. When the destructor is called, the garbage collector is invoked to process the queue. If the destructor is empty, this just causes a needless loss of performance.
|
|
|
|
|
hi all
i want to Extend a Property for a class
is there some thing like Extension Methods for properties?
|
|
|
|
|
Extension methods only work at the class level.
Depending on what you want to do, you may have a couple of options. You'll either have to inherit from the class and override the property or add another property and call the base class property from it.
|
|
|
|
|
i know bun unfortunately i can`t derive from desired class because it force me to change all of the project .
in addition i am looking for a better solution
|
|
|
|
|
reza assar wrote: i know bun unfortunately i can`t derive from desired class because it force me to change all of the project
Sounds like the requirements and specs changed after development started. You really have to plan ahread for these things.
reza assar wrote: in addition i am looking for a better solution
You don't have one. Extension methods cannot be attached to a property of a type, only to the type itself.
|
|
|
|
|
hi!
I have a listview , which contains some records with checkbox.
I have also a linkbutton for select all, delete and so on.
my query is, when i click on select all(link button) all checkbox has select.
please help me.
i use this code, but not work :
protected void lnkSelect_Click(object sender, EventArgs e)
{
foreach (ListViewDataItem lvItem in lstView.Items)
{
CheckBox check = (CheckBox)lvItem.FindControl("chksel");
if (check != null && check.Checked)
{
check.Checked = true;
}
}
}
thanx & regards
|
|
|
|
|
Message Closed
modified 23-Nov-14 5:55am.
|
|
|
|
|
hi!
I use your code ,listViewItem.checked but (.checked) is not populated.
|
|
|
|
|
|
Hi...
In my application , we are using sql server for data store . For our test case , we want insert dump datas . but datas has in the format of file is .adi and .adt format file ( When i search in google its sybase database ) . we need to get data from that format file to sql server . Please help me welcomes ur idea and helps
Thanks
|
|
|
|
|
I'd install a sybase database engine on a virtual machine, restore the database from those files, and then look for a migration tool from sybase to SQLServer (I do not know if it exists...)
Good luck!
|
|
|
|
|
Thanks for reply
not have sybase migration software.. if u have these software download URL , please send me .. Its most helpful to us ..
|
|
|
|
|
Thanks for reply
not have sybase migration software.. if u have these software download URL , please send me .. Its most helpful to us ..
|
|
|
|
|
I have CheckBoxList. I am binding data to checkbox List from DataBase. How can I Get Listitem value using Javascript.
|
|
|
|
|
You do realize that you have posted a JavaScript question in the c# Forum, don't you?
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.”
|
|
|
|
|
Hi All,
I am working on developing a application (Windows Application) where in the application gets the content (majorly flash content) from a content server and takes the snapshot and gets the RGB data out into a buffer at x fps. This buffer is then passed to a display stack which handles the off-screen rendering.
I am using IECore as the renderer. I am able to capture the snapshot of the web content and save it as bmp file (shown below).
To get the content
AxWebBrowser web = new AxWebBrowser();
web.SetBounds(0, 0, 1024, 600);
web.Navigate2(ref URL, ref oNull, ref oNull, ref oNull, ref oNull);
Application.Run();
private Graphics grp;
private IntPtr hdc;
private IViewObject vw;
private IHTMLDocument2 doc;
public void Capture()
{
doc = (IHTMLDocument2)web .Document;
web.SetBounds(0, 0, width, height);
image = new Bitmap(width, height);
grp = Graphics.FromImage(image);
_RECTL bounds;
bounds.left = 0;
bounds.top = 0;
bounds.right = width;
bounds.bottom = height;
hdc = grp.GetHdc();
vw = doc2 as IViewObject;
vw.Draw(1, -1, (IntPtr)0, (IntPtr)0, (IntPtr)0,
(IntPtr)hdc, ref bounds, (IntPtr)0, (IntPtr)0, 0);
grp.ReleaseHdc(hdc);
image.Save(fileName);
image.Dispose();
}
}
I am hopefule that we will have some mechanism to extract the RGBA data out of it. But I am not getting the clue of handling the mouse events. here the rendering is happening to a memory and not to a window (off-screen rendering).
The display sdk (a C dll) requires the application to register a call back funtion to get the mouse related data. The information that I will get is the left down/up, move and x and y co-ordinates.
Now, what I want to know is, how to register a call back function and how to pass the mouse information to the IE Core so that it responds as if it was clicked on a normal window.
Any help is appreciated. Please do the needful.
Regards,
HalliHaida
|
|
|
|