CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.08 seconds.

  1. Re: Filter a txt file based on an Excel template

    I've now had a look at this. Sorry, but I don't understand the requirement. If you're unable to provide working VBA code for conversion to C++ as previously, you're going to have to be much more...
  2. Re: Filter a txt file based on an Excel template

    It's not homework. In a previous thread (https://forums.codeguru.com/showthread.php?565022-RESOLVED-Filter-a-txt-file-based-on-an-Excel-data-sheet&p=2237550&highlight=#post2237550) I converted some...
  3. Replies
    7
    Views
    931

    Re: Creating a Directory

    Colon is also used to name an alternate NTFS file stream. See http://www.flexhex.com/docs/articles/alternate-streams.phtml
  4. Replies
    17
    Views
    981

    Re: Excel writing time is inconsistent.

    The OP won't/hasn't posted the XML file and the VB script. So....

    In these cases, I'd be looking to read/process the XML file separately to (outside of) Excel, to produce say a csv file that can...
  5. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    The code you have will probably give the best performance. In 'simplifying' this, you are likely to have an impact on performance. In these sort of cases, I'd be thinking about performance over...
  6. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    For the original SortInfo(), this can be a little simplifed:



    void SortInfo(CS* pS, TECH eTechType, PiInfo* pIIInfo, MiInfo* pMInfo, size_t x, size_t y)
    {
    const size_t minIndex =...
  7. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    Sorry I can't help with this as I don't use boost.

    But as a comment, aren't you in danger of replacing something 'complicated' with something that's could be equally as complicated with a worst...
  8. Replies
    17
    Views
    981

    Re: Excel writing time is inconsistent.

    To parse and generate the Excel file shouldn't take anywhere near 30 minutes - never mind over an hour.

    Can you post an XML file, the VB script and a link to a generated Excel file. There's...
  9. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    AFAIK, you can't. You can't assume anything about sort/qsort other than the provided function will get 2 values to compare. Even if somehow you found something, that may well change with the next...
  10. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    Nope.
  11. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    Not really. t1 stored in stack space and not heap space - so t1 is a ref to a temp variable used in the sort algorithm.
  12. Replies
    17
    Views
    981

    Re: Excel writing time is inconsistent.

    But you haven't answered my question in post #5 re the size of the XML file and the size of the excel spreadsheet.

    Is there anything else being done on these computers while this is being done?
    ...
  13. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    But if you sort pIIInfo, then you won't know which pMInfo elements need to be swapped - will you?
  14. Replies
    17
    Views
    981

    Re: Excel writing time is inconsistent.

    What is the size of the XML? What is the size of the resultant excel (rows/columns?). Is the version of Excel the same on both machines? What are the specs of both machines(cpu/memory/type of drive...
  15. Replies
    6
    Views
    1,278

    Re: header files online database

    vector is a C++ container. If you have reference to a vector in C code, then you'll need to obtain the definition as it probably won't be the same/have the same interface as the C++ one.

    You could...
  16. Replies
    21
    Views
    1,086

    Re: replace with sort algorithm

    This looks like a quicksort.

    It seems to be be sorting pIIInfo. To use std::sort, you need to specify the begin and end iterator and define an operator<(a, b).

    Where does pMInfo fit into this?...
  17. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    So did I in the code in my post #18!

    As well as begin/end, cbegin/cend, there are also rbegin (reverse iterator - starts at the end and iterators to the start) & rend. Use them just like begin/end...
  18. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    Sorry. I looked at the code and didn't see the same problem you didn't see. You're got the order of the parameters wrong. Should be:



    std::transform(r1->begin(), r1->end(), r2->begin(),...
  19. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    What about



    std::transform(r1->begin(), r2->begin(), r1->end(), back_inserter(r), [](int i, int j)


    transform requires an iterator - not a const_iterator. That's probably what the compiler...
  20. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    OK. As mat1, mat2 are declared const, you need to use cbegin/cend rather than begin/end. This then compiles.
  21. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    What makes you think that i, j are ints?



    As mat1 and mat2 are of type vector<vector<int>>, aren't i and j of type vector<int> ?
  22. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    Input iterator access doesn't 'alter' the source data. But the part to which it points changes. Think of a string stream as a file. When reading a file, the contents of the file doesn't change, but...
  23. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    When you extract from a string stream, the stream gets incremented.
  24. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    Note that you can only use ++ on istream_iterator. You can't increment by a number.

    If you put istream_iterator<int> ii(is) outside of the loop and increment within the loop, you don't get the...
  25. Thread: Matrix input

    by 2kaud
    Replies
    22
    Views
    1,057

    Re: Matrix input

    istream_iterator<int> eCol = iit + (CC -1);


    You can't do arithmetic with an istream_iterator<>.

    If you want to read the input data like this, consider:



    #include <vector>
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)