dcsimg

Search:

Type: Posts; User: kedaman

Page 1 of 13 1 2 3 4

Search: Search took 3.44 seconds.

  1. Replies
    1
    Views
    359

    reading big files

    How can i read files using 64 bit file pointer in linux?
    Thanks.
  2. Replies
    5
    Views
    1,239

    Re: Converting a double digit to single digit

    Well the example shows how to do that, but thats not the point. I guessed he was asking for how to convert a string of digits to an integer.
  3. Replies
    5
    Views
    1,239

    Re: Converting a double digit to single digit

    http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html
  4. Re: KDE: text on minimized windows in taskbar give me a headachie

    Hmm.. I installed kdmtheme using adept manager but it does not show up in system settings. Isn't there any way to change the colour of the text more directly?
  5. Re: KDE: text on minimized windows in taskbar give me a headachie

    I didn't like gnome compared to KDE, but there is only this one thing that irritates me. I temporarly made the background white on my panels as grey on white is a slight (but far from satisfactory)...
  6. KDE: text on minimized windows in taskbar give me a headachie

    The minimized windows have a greyish colour that is hard to read against the grey background on the taskbar, can't I change it somehow? :(
  7. Replies
    5
    Views
    545

    Re: Validating signed decimal numbers

    never mind sscanf, use strtod:
    http://www.cplusplus.com/reference/clibrary/cstdlib/strtod.html


    char str [5]="5.43",*endp;
    strtod (str,&endp);
    if(!*endp) cout << "str is a number"<<endl;
  8. Replies
    5
    Views
    545

    Re: Validating signed decimal numbers

    sscanf will tell you if the string you pass to it is a number.


    char str [5]="5.43";
    if(sscanf (str,"%*f")) cout << "str is a number";
  9. Replies
    2
    Views
    488

    Re: Console Calculator

    My suggestion would be to do a stack based calculator. A stack based calculator, is even less restrictive, since it can do things like (2+3)*(3+4) where you have to store more than one result of...
  10. Replies
    5
    Views
    545

    Re: Validating signed decimal numbers

    http://www.cplusplus.com/reference/clibrary/cstdio/sscanf.html
  11. Replies
    4
    Views
    1,262

    Re: Templates - Advice I suppose.

    You are asking the wrong questions. If you are looking for particular examples in which a template could be useful, you are trying to clean your teeth with a hammer. To understand the real power...
  12. Thread: !, nPr, nCr

    by kedaman
    Replies
    16
    Views
    5,786

    Re: !, nPr, nCr

    Today i wrote this code:


    int nCr=1,i=0;
    while(i!=r)
    nCr=nCr*(n-i+1)/i++;

    an algorithm that was presented here, that will be able to deal with larger integers without being inefficient:...
  13. Thread: !, nPr, nCr

    by kedaman
    Replies
    16
    Views
    5,786

    Re: !, nPr, nCr

    It should give you 42 yes, in base 13 :D

    A note about recursion vs iteration: it is very unfortunate that this is the case but recursion is generally less efficient, but merely in the sense that...
  14. Thread: !, nPr, nCr

    by kedaman
    Replies
    16
    Views
    5,786

    Re: !, nPr, nCr

    It makes your life easier ;)

    actually it is an attempt to answer one of those mystery questions:
    http://www.google.com/search?hl=en&safe=off&client=opera&rls=en&hs=wE8&q=six+times+nine&btnG=Search
  15. Thread: !, nPr, nCr

    by kedaman
    Replies
    16
    Views
    5,786

    Re: !, nPr, nCr

    Also this is not a good idea:

    Factorial(n) / Factorial(n - r)

    For instance, if you have n=10 and r=2, you only need to calculate 10*9, but what the above will do is to calculate...
  16. Replies
    5
    Views
    468

    Re: Reading a text file

    http://www.cplusplus.com/reference/clibrary/cstdio/fscanf.html
  17. Replies
    1
    Views
    527

    Re: logarithm graph- how?? NEED HELP

    log x / log a
  18. Replies
    3
    Views
    3,023

    Re: Shrinking a Polygon

    just replace C with whatever point you want the polygon to shrink toward.
  19. Replies
    3
    Views
    474

    Re: Finding windows

    EnumWindows will allow you to loop through all top level windows using a callback function. EnumThreadWindows will loop through all top level windows of a thread and Thread32First and Thread32Next...
  20. Thread: I'm over OO.

    by kedaman
    Replies
    49
    Views
    2,177

    Re: I'm over OO.

    Nice to see someone else who hates OOP and thinks it smells :D
    OOP bundles together data and functions - this is highly undesirable and annoying. The concept used in for instance Haskell classes...
  21. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    Hmm.. garbage collection... are they going to turn C++ into java? Concepts looks really nice - especially concept based overloading. This way you can do various things on different sets of types...
  22. Replies
    3
    Views
    3,023

    Re: Shrinking a Polygon

    Certain amount of distance? Do you mean the perimeter of the polygon should be reduced a certain distance by shrinking the polygon? If so then it should shrink proportional to the ratio between the...
  23. Replies
    4
    Views
    1,247

    Re: ASM Function In C++

    Those errors look like msvc errors to me, and msvc uses double underscore for inline asm as chemicalNova said i.e. __asm
    For hexa decimals use 0x as a prefix for those number.
  24. Replies
    5
    Views
    621

    Re: what is the use if static keyword

    Both functions do the same thing, but in the latter, the this pointer of the instance x is passed in the call:
    T x;
    x.add(a,b);
    in fact the latter could be described as doing this:
    T.add(x,a,b);...
  25. Replies
    55
    Views
    8,882

    Re: C++ Is A Dying Language?

    The reason why C++ will die soon is concisely stated in my signature.
  26. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    struct c{
    template <class X> int foo(){return 0;}
    template <> int foo<int>(){return 1;}

    };

    gives
    test.cpp:11: error: explicit specialization in non-namespace scope ‘struct c’
    test.cpp:11:...
  27. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    I forgot I got my live cd with me, it appears I have 4.1
  28. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    I don´t have access to my machine at the moment but I don´t think the version is particularly old. It came with the latest ubuntu distribution i downloaded a couple of months ago. You are not really...
  29. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    Also... is it at all possible to make template specializations for member functions in template classes? I don't seem to be able to do either partial or explicit specializations in gcc.
  30. Thread: Compiz Beryl

    by kedaman
    Replies
    8
    Views
    1,371

    Re: Compiz Beryl

    I tried it out in ubuntu, but scrolling or resizing windows is annoying slow :(
  31. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    Long time no see woss :D

    I'm only compiling with -fpermissive, but thats only because I haven't figured out how to fix this strange error yet:


    rms.cpp: In member function ‘void...
  32. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    Well that is certainly interesting. Maybe its just gcc that is at fault. I'd be happy to know if DevCPP is capable of it. Thanks.
    BTW, if you remove the T paramteres, will it compile?
  33. Thread: organic

    by kedaman
    Replies
    464
    Views
    7,827

    Re: organic

    The reason why the brain is not a computer is because we didn't design it. Computers are a class of artificial objects, their purpose being computation; humans are not artificial objects.
  34. Replies
    13
    Views
    1,072

    Re: partial template specialization problem

    Here's a workaround that seems to work :D


    template <class H>
    struct c{
    template <class X,class Q,class T=void> struct h2{
    static const bool val=false;
    };
    template <class Q, class T>...
  35. Replies
    13
    Views
    1,072

    partial template specialization problem

    Its only partial because gcc doesn't seem to like it otherwise nor does it seem to be allowed in the ISO standard, although I have a vague memory it used to work in MSVC..

    Anyway, this gives me 0...
  36. Replies
    11
    Views
    1,917

    Re: Implementing Kleene closure

    It doesn't actually concatenate, that's not the right word, concatenation is what ++ does. Lists (and thus also strings) in haskell are like stacks and p:q means p is the topmost element and q is the...
  37. Replies
    11
    Views
    1,917

    Re: Implementing Kleene closure

    Ok so there was a way to sneak around that too, but I guess thats only because the example is so simple. But if we have something very complicated there instead of eos, perhaps even have c* then I'm...
  38. Replies
    11
    Views
    1,917

    Re: Implementing Kleene closure

    Yeah that makes sense, as a factor in fact is a term and so it tries to match as much as possible while in factor, it gets the whole 3*5 with it.
    In the first example, can't you put some sort of...
  39. Replies
    11
    Views
    1,917

    Re: Implementing Kleene closure

    it could be rewritten as
    "abb|ab"
    but that last b could be involved in a more complex expression which would make it hard if not impossible to extract it and likewise (ab|a) could be a very complex...
  40. Replies
    11
    Views
    1,917

    Re: Implementing Kleene closure

    Well, apparantley thats something you would need to do to parse say an integer, but is it really that resource consuming? Thanks for the suggestion though although I figured I would have to do...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width