473,800 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling n methods

Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of data
comprising these x items
Oct 3 '07 #1
4 1069
That all depends on the structure of your "time series" class.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"b1uceree" <b1******@discu ssions.microsof t.comwrote in message
news:BD******** *************** ***********@mic rosoft.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items

Oct 3 '07 #2
its a standard net 2.0 container returning a timeseries with dateTime and
value for each element in the array. You can access data in the container by
index (starting from 0. ie

doubleSeries series = new doubleSeries();

// Get second element
double secondValue = series[1];

//Getting the second to last value
for (int i = 1; i < series.Count; i++) {
double value = series[i];
}

// Get the last value
double lastValue = series.Last;

// Get the first value
double firstValue = series.First;
"Kevin Spencer" wrote:
That all depends on the structure of your "time series" class.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"b1uceree" <b1******@discu ssions.microsof t.comwrote in message
news:BD******** *************** ***********@mic rosoft.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items


Oct 3 '07 #3
On Oct 3, 8:26 am, b1uceree <b1uce...@discu ssions.microsof t.com>
wrote:
its a standard net 2.0 container returning a timeseries with dateTime and
value for each element in the array. You can access data in the container by
index (starting from 0. ie

doubleSeries series = new doubleSeries();

// Get second element
double secondValue = series[1];

//Getting the second to last value
for (int i = 1; i < series.Count; i++) {
double value = series[i];

}

// Get the last value
double lastValue = series.Last;

// Get the first value
double firstValue = series.First;

"Kevin Spencer" wrote:
That all depends on the structure of your "time series" class.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"b1uceree" <b1uce...@discu ssions.microsof t.comwrote in message
news:BD******** *************** ***********@mic rosoft.com...
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of
data
comprising these x items
You can use a for loop backwards:

int x = 5;
for (int i = series.Count - 1; i >= (series.Count - x); i--) {
//perform calculation with series[i]
}

Chris

Oct 3 '07 #4
Hi,

What can't you manage to do ?
for int index=list.coun t-1;i>0;i--
{
[...]
}
where 'list' could be a List<double>

b1uceree wrote :
Hi,
i need to work out a solution to this:
i have a class that is a time series of (double) numbers and i want to do
the following calculation
for
int x;
i need to perform a calculation which will, starting with the last item
added to the time series perform calculations moving backwards through the
timeseries x items back and return these calculations in a new series of data
comprising these x items
Oct 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2418
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. Generally, the documentation suggests that queues or similar constructs should be used for thread inter-process comms. I've had a lot of success in doing that (generally by passing in the queue during the __init__ of the thread) and I can see...
14
6411
by: Axel Straschil | last post by:
Hello! Im working with new (object) classes and normaly call init of ther motherclass with callin super(...), workes fine. No, I've got a case with multiple inherance and want to ask if this is the right and common case to call init: class Mother(object): def __init__(self, param_mother): print 'Mother'
1
1583
by: Stephen Kellett | last post by:
Hello everyone, I'm trying to do something in C calling Python and its failing. I'd be grateful if you could take a look and hopefully you have an answer. What I'm trying to do is determine the address of the "collect" function in the "gc" module. I want to do this so that we can determine when a garbage collection happens, regardless of how it is triggered (explicitly by a user call, or implicitly by the behaviour of the program...
3
2215
by: Cindy Liu | last post by:
Hi Everyone, I created C# COM+ component. It has two overloaded methods - the method names are same and their signatures are different, one takes two parameters and another takes four. I coded this way: the method with 4 parameters is coded first and then the one with 2 parameters. I created very simple ASP page to call these two methods. Calling the method with 4 params has no problem. However, calling the method with 2 params I get the...
5
2236
by: Dave | last post by:
does calling a regular function cost any cpu time? In other words, is it faster to write the code of two functions into main(), or is it the exact same thing as calling two functions. I know its nitty gritty but its necessary for my program. thanks dave
1
6741
by: Lakshmi | last post by:
Hi All, I am having performance issues with the .NET client calling the Java Webservice running on axis. Have detailed the problem below. Please help. I wrote a webservice in Java. Lets name this WebService1. (using Apache Axis 1.1) Scenario 1: -----------
6
1920
by: Rob Cowie | last post by:
Hi all, Is there a simple way to call every method of an object from its __init__()? For example, given the following class, what would I replace the comment line in __init__() with to result in both methods being called? I understand that I could just call each method by name but I'm looking for a mechanism to avoid this.
6
1986
by: Anthony Smith | last post by:
I can call a class using "->", but it complains about the :: I see on the net where :: is used. Is there a good explanation on when to use one over the other or the differences? $help = new help(); $help->foo(); $help::foo(); class help{
6
11582
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use another convention unless they have an ellipsis argument.) I can force GCC and other compilers to use such a convention by declaring all methods with an ellipsis, but I'd rather not clutter my method definitions with these.
1
2790
by: svatauli1983 | last post by:
Hi all, can someone write me if is normal to have business layer of static methods. Example: from page.aspx.cs calling static method in other assembly (static methods doesnt use state variables). Can be some problem when more requests will be calling that static method in same time? And How static methods works? That method is created (new instance of some object) when it is calling and in the end is disposed? Thanks
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.