Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Disruptive
  • Content: Threads
  • Order by date
  1. Disruptive

    Simple Perl script

    Hi I am having trouble trying to read in name, value pair data from a text file. I want each name and value on each line and be able to check the value of each name or value indepently (stored in sep varables). I seem to have tied myself in knots trying to get this working. #!/usr/bin/perl...
  2. Disruptive

    Quick algorithm wanted

    Hi In my efforts to speed things up somewhat I would like to output an integer (1) if x > Xmax or x < 0, but if x is between the limits 0 to Xmax then will return. Obviously I can write withif then and have done so, but as this routine is being called billions of times any potential time saving...
  3. Disruptive

    Timing a loop in microseconds

    How can I introduce timing for a routine/loop in C, I seem to see so many conflicting and not working examples on the web. I can time in seconds but some of these processes are lasting less than a second so it does not help with my optimisation. Could some point to some useful code that will...
  4. Disruptive

    Real array in UNIX script

    Hi I am keen to create an array which stores real numbers which I can then loop through. I have tried using the bash script, but I cant see any literature which states whether I can actually get real numbers into the arrays. The sort of code I have put together is: #!/bin/bash KT[1]= 1.0 or...
  5. Disruptive

    fmod quick?

    Is there a quicker alternative that someone knows about? is it quicker in peoples experience to use ifs? fmod((xpos + Xbox), Xbox) ALSO I am toggling between 0 and 1, I use the following code (currenttoggle + 1) % 2; which works fine, however I am looking for speed-up. Any ideas? Cheers
  6. Disruptive

    Speed and array passing

    Hi I have some simulation code which passes all arrays by reference to the required function block. I have avoided global variables even though this would be the easiest method and therefore I have functions which are being send maybe 10-15 arrays and the headers are quite cumbersome. However...
  7. Disruptive

    Fast 2D array copy

    Hi I am repeatedly copying the array elements from old array to new array, performing operations on the new array (changing) in the process and then determining whether or not use the new array values or the old ones. To speed things up what I do is create a new array and using pointers...
  8. Disruptive

    Sed and regular expression

    Hi I wish to alternately change some of the data in the following way. For example I wish to switch all species from their current value to their binary opposite. I.e. from 1 -> 0 and from 0 -> 1 when the LIPID number is even. Now the data is on the file such that the LIPID number is before the...
  9. Disruptive

    &quot;In function&quot;

    I need some advice on the quickest method of checking whether a number is contained in an array. I have an single dimension array of variable length. I need to perform a check to see if a number is contained within the array. Currently one can look through the array. However this is very time...
  10. Disruptive

    Mod function

    To save time, I'd love to be able to use the mod function in a calculation, this would be fine if I was using integers. But by using reals or doubles I cannot do this. The algorithm I am using is something like this (x + y) mod y. All are defined as integers. Any ideas how to do something like...
  11. Disruptive

    Include files

    Hi I have include files that are stored in the following way. How do I access them when reffering to them in the include file? /main make files main/dir1 xyz.c xyz.h main/dir2 123.c 123.h How do I refer to the xyz header file from the dir two directory? Any help would be most appreciated/. I...
  12. Disruptive

    Pointers and Arrays.

    Peraps this one is obvious. I have te following and wish to create a pointer to point at a two dimensional array which is declared as below. I then wish to send this function in the following way to a function. Pointer asignment does not work. I have: void f1(int ***ptrCell) {...
  13. Disruptive

    Storage classes and variable passing

    void mycreatedynamicstorage(int **MyArray) { by malloc -allocate some 2D storage for the variable above. } void populatestorage(int **MyArray) { Simply populate the sample. } int main(void) { int **MyArray; mycreatedynamicstorage(MyArray); populatestorage(MyArray); } My question...
  14. Disruptive

    Shared variables

    Hi Am having a bit of trouble with variables not updating when they should when they are declared with the extern keyword. I have taken an example from the web to try this out and still it does not work. Do you have any idea where this is going wrong. I keep getting the old values and the new...
  15. Disruptive

    Array passing c++ BETA.

    I have the beta version of VS.NET using C++. 2005 I am noting some strange behaviour when passing a three dimensional array around a number of functions. By default c++ should be passing the array by default as I cascade through functions i.e. fn A passes array to function B which passes array...

Part and Inventory Search

Back
Top