Produce A Moving Average From A Queue(of MyDataClass)?
Jul 12, 2011
I have a scientific datalogging program which I have been developing for a number of years now. We now need to add some functionality so that it produces a moving average of the data being gathered. I can create a queue of myDataClass to do the fifo buffer but I was wondering what the best way doing the averaging might be. As you can see from the code example below myDataClass contains various data structures some of which can be averaged and some which cannot (e.g. the string).
View 6 Replies
ADVERTISEMENT
Sep 8, 2009
I'm working on a function to return a exponential average and there are a lot of examples of exponential moving averages but they all start with a moving average that is just the mean as a lead in to calculating the continuing moving average. I needed just a exponential average of a value set. After Googling my Bing off I still haven't seen anything so here is my attempt at a basic exponential average. Is this correct? Are there any errors? I have seen some text about adding a smoothing value to change the curve of the exponential average but not how that would be implemented.
[Code]...
View 5 Replies
Jan 13, 2009
I am looking for a way to find the moving average for customers over a 30 day period. However I was not able to find any sample VB code to help get me started. I did find this C# sample on Code Project but my attempts at conversion have not been successfull.
Does anybody have an existing VB class they would like to share or do you know of a sample that I could use to build my own?
View 4 Replies
Jun 15, 2010
I want to include an average in a column where the average ignores zero values in a report cell where the column may have
17
19
0
[code].....
I want 16, not 11 so (17 + 19 + 12 + 13 + 19) / 5 not (17 + 19 + 0 + 0 + 12 + 13 + 19) / 7 Something like this if it would work.
=SUM(Fields!fieldname.Value) / Count(iif(Fields!count_cycle_per_hour.Value >= 0,Fields!fieldname.Value,0))
Essentially just average everything in the column NOT a zero?
View 4 Replies
Mar 26, 2012
I put comments on the average output since I kept getting error messages about that. My out keeps saying:
Maximum value: 33
Minimum value: 33
what am I doing wrong?
Option Explicit On
Option Strict On
[Code]...
View 2 Replies
May 10, 2011
I'm in a computer science class, and we are writing simple programs using Visual Basic 2008. I am really inept when it comes to this, as I have never done it before. I need to write a program that: "Asks the user for 5 numbers and computes the average. It then displays the average with an appropriate message before the average."
I have been really close with this, but I can't get the numbers to add up, then divide by 5, and display a pop up message.
View 13 Replies
May 14, 2011
I have a form that has a queue and i want to transfer that queue to another queue in another form. however when i try to use the elements in the second queue after transfer, I get the error message queue empty!below is my code
First Form
Imports System.Collections.Generic
Public Class Form1
[code].....
View 2 Replies
Oct 5, 2008
I have this:
Private m_PerformanceCounter As New _
System.Diagnostics.PerformanceCounter( _
"Processor", "% Processor Time", "_Total")
[code]......
View 4 Replies
Nov 30, 2011
I have an array that I'm basically treating like a queue (FIFO)I'm trying to decide the fastest way to implement this.Currently I'm just iterating through and shifting everything up an element and placing the new data @ 0. This was fine when I was dealing with 1000 element arrays, but now I'm moving up to 100k element arrays and it's stalling my code.It has been useful to have the data in array form because I'm using the array.sort method and a few other statistical modifications that use the element number (of the sorted list) to work.I'm not sure if VB lists are (like Java) pointer based, and if so I think that shifting pointers would execute faster than my current approach.My question is, if I did move to a list would it a) be faster, and b) is there a way to call a quick sort from the list class?If the execution time is the same for the array vs. list is there a better way to make a FIFO structure in VB?
View 2 Replies
Mar 2, 2010
how "peek" really operates or something but what I'm trying to do is have 2 separate audio files play one after the other over and over again.I was expecting that I would hear wav1 and wav2 alternate but I only hear wav1 on each cycle.Doesn't peek use the first data then push it to the back without discarding it?Therefore wav2 would be next in line to be played? [code]
View 14 Replies
Jan 30, 2012
Has anyone seen a .net email queue? I want to be able to specify the SMTP server to send via, report problems and retry emails if necessary or requested.
View 2 Replies
Apr 3, 2012
PrivateSubForm1_Load(ByValsender
AsObject,
ByVale
AsSystem.EventArgs)
[code]....
View 4 Replies
Oct 28, 2009
'I am having trouble with the line "senda = suba(sendaobj, EventArgs.Empty)". [code]...
View 12 Replies
Aug 25, 2009
Here's the
Sub DestroyUser(ByRef Victomcheck As Integer, ByRef Victorcheck As Integer)
Dim num As Object
WriteSub("destroyuser")
[Code]......
View 5 Replies
Jun 10, 2011
i am making a hairstyle and makeup software in vb and i need to upload the picture which will be edited, to put a hairstyle and makeup on. ive no idea how i can do it.. it is a virtual makeover software and i need to produce the before and after images. please someone help me, my deadline is on the 31st
View 3 Replies
Jul 28, 2011
How can I clear the printer queue from VB? if I was doing it manually I would stop spooler service, empty the windowssystem32spoolprinters folder and restart the service
View 8 Replies
Apr 13, 2012
What is the difference between a queue(of t) and list(of t)? I've been working a lot with list(of t), but up until recently I haven't even heard of queue(of t). I know that they are both general list.
View 3 Replies
Jun 27, 2010
I am currently creating a FTPWebrequest to handle my uploading (the webrequest section of my function is below). At the moment my code loops through this webrequest section for each file - giving the file path of each file in the string "CompleteLocalPath". For each file it creates a webrequest and giving the required file path, uploading the file using a file stream, and then closing the stream. This works, but seems to take quite a long time. Can you recommend a more efficient way? Perhaps by using one webrequest but modifying the upload path?
[Code]....
View 2 Replies
Apr 19, 2011
I have a program that is using API's to send mouse events and keyboard events to another application that is running. I need to know how to tell if there are any messages left to process for that window after I have click on a button or moved to the next field. I need to know this so I don't send any more mouse or keyboard events until it has finishing processing everything in its message queue. An example is that I click out of the key field and the form has to go out and read a client record. This may take a second or two, so I need to wait until the form is ready for more input.
View 2 Replies
Aug 7, 2009
The below code (VB 2008) will check the print queue every milisecond for a job. It will then show the pagecount in a text box. It works great when im printing to a local printer, but As soon as I change my pc default printer to a network printer, I cant capture any data.
View 1 Replies
Apr 9, 2009
I'm looking for a way to move a printjob from a paused printer to another printer. I have looked at the new name space System.printing in .Net framework 3.X.Is there a way to do it in .NET?An externa application creates a printjob.I catch the event "a printjob add" in the printqueue.I pause the printjob.Now I want to move the printjob to another printerIs there a way to do it in .NET?
View 13 Replies
Aug 20, 2009
Say I have a rolling collection of values where I specify the size of the collection and any time a new value is added, any old values beyond this specified size are dropped off.Obviously (and I've tested this) the best type of collection to use for this behavior is a Queue:
myQueue.Enqueue(newValue)
If myQueue.Count > specifiedSize Then myQueue.Dequeue()
[code].....
View 5 Replies
Aug 26, 2010
We have made code for writing to and from a IBM message queue.Writin goes well, but reading gives an error, see bold text
[Code]...
View 3 Replies
Aug 22, 2011
Are the following 2 SQL statements the same? Will they produce the same results?
sql1 = "SELECT * FROM [StudentDetials] WHERE ([Subject1] LIKE '" & Subject(0) & "' OR [Subject2] LIKE '" & Subject(0) & "') AND ([Day1] LIKE '" & TabDay & "' OR [Day2] LIKE '" & TabDay & "') AND ([Time1] >= '" & Time(0) & "' AND [ETime1] <= '" & Time(1) & "' OR [Time2] >= '" & Time(0) & "' AND [ETime2] <= '" & Time(1) & "')"
sql1 = "SELECT * FROM [StudentDetials] WHERE ([Subject1] LIKE '" & Subject(0) & "' AND [Day1] LIKE '" & TabDay & "' AND [Time1] >= '" & Time(0) & "' AND [ETime1] <= '" & Time(1) & "') OR ([Subject2] LIKE '" & Subject(0) & "' AND [Day2] LIKE '" & TabDay & "' AND [Time2] >= '" & Time(0) & "' AND [ETime2] <= '" & Time(1) & "')"
In my case they simply produce the same results but that's because of the data i'm using.
View 1 Replies
Dec 23, 2011
I tried to convert following C# code into VB.NET and got "Expression does not produce a value" error while compiling the code
C# Code
return Fluently.Configure().Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyEntityMapping>())
.Database(SQLiteConfiguration.Standard.InMemory().ShowSql())
.ExposeConfiguration(x => new SchemaExport(x).Execute(false, true, false))
.BuildSessionFactory();
VB.NET Code
Return Fluently.Configure() _
.Mappings(Function(m) m.FluentMappings.AddFromAssemblyOf(Of SubscriptionMap)()) _
.Database(SQLiteConfiguration.Standard.InMemory().ShowSql()) _
.ExposeConfiguration(Function(x) New SchemaExport(x).Execute(False, True, False)) _
.BuildSessionFactory()
The error happens on 2nd last line of VB.NET code, while C# code is compiled without problem.What is wrong with the converting?
View 1 Replies
Dec 23, 2011
I tried to convert following C# code into VB.NET and got "Expression does not produce a value" error while compiling the code
[Code]...
View 7 Replies
Apr 1, 2011
I am porting over some code from .net (vb) to php and I came across some md5 hashing that I can't reproduce in php. In the .net one there are two functions one uses UTF-8 encoding and the other uses Unicode encoding. The output is a different hash when passed in a string
// First function (returns GUID)
Dim oHasher As Cryptography.MD5 = Cryptography.MD5.Create()
Dim oEncoder As New System.Text.UTF8Encoding()
Dim csData() As Byte
[Code]...
but they both produce the same result. Is it possible to produce the same results in php with md5 hashing?
View 1 Replies
Jun 2, 2010
I'm using the below code to produce a ToolTip for each row of a ListView.
When moving vertically across the ListView a ToolTip will appear when the mouse touches between two rows - bypassing any of the ToolTip's options.
Private m_HoveredItem As ListViewItem
Private Sub ListView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lv.MouseMove
[Code].....
I'm not using the ShowItemToolTips property of the ListView because I want to have a more formatted ToolTip (ToolTipIcon, Title etc) I don't believe these options can be set for the ListViews ToolTip?
I've updloaded a sample project of the issue here: [URL].
View 1 Replies
May 28, 2009
I have created an program that can produce an XML file from the SQL database.and the code is looks like below:
[Code]....
why is there a <NewDataSet></NewDataSet> node?2. How to remove that node?
View 4 Replies
Mar 14, 2009
I am now looking for a way to produce pdf files from xls files. Since the completed programme will be distributed to others, it would have to work on environment without the "pdf producer" I am using.Which is the "pdf producer" to use"?I am now working on the express version of VB 2005 (which does not have crystal report). I have acrobat 8.0 installed but have not figured out how to do that...
View 2 Replies