User Profile

Collapse

Profile Sidebar

Collapse
sanctus
sanctus
Last Activity: Apr 17 '08, 07:49 AM
Joined: Mar 22 '07
Location: Switzerland
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sanctus
    started a topic automatically append & to all comands in terminal?

    automatically append & to all comands in terminal?

    I do not know if this is dangerous for comands that dispaly something in the terminal (I tried grep -r 'something' /somewhere & and it worked fine), but I would like to append to all my commands & automatically (it saves me typing C-z bg everytime I forget)?
    Is there a way to do it for all comands? The only way I know would be with aliases in .bashrc, but this would be a bit too cumbersome...

    Thanks very much.
    See more | Go to post

  • sanctus
    started a topic emacs question

    emacs question

    I do not know if this is the right section for my question (or if even there is the right section for this), in case move it.

    I'm using emacs in matlab-mode to edit (surprise :) ) matlab files. The comments begin with "%" and I defined them to be green. Now I would like to add another type of comment (for example beginning with "&" or "%&" and defined to be red) in order to make a difference between...
    See more | Go to post

  • sanctus
    replied to Compiling Error
    in C
    Also, I do not know if
    [code=cpp]
    int my grade
    [/code]
    is allowed since it is made of 2 words... Shouldn't it be:
    [code=cpp]
    int my_grade
    [/code]
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to g++ compiled/linked program doesnt work
    in C
    lol! I had the same problem a year ago, when I started on linux. It will work np with the comand ./
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to help with recursion
    in C
    How are the subgroup defined? Any possible combination of the elements of the int array or something else?

    Why don't you post what you have come up with?...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to if else brackets problem
    in C
    If you follow Sick0Fant's suggestion the for-if-else if etc. should work, I do not see the point though in saying:
    [code=cpp]
    else if (i<3 && i<6)
    [/code]

    Because if i is smaller than 3 it is always smaller than 6......
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Problem with simple string function
    in C
    I have used plenty of times (can't remember how many as most of you I guess) the function from a class and hence the scope resolution opearator...sho uld have seen it but I guess staying away a little while from coding can even make you forget the "obvious" stuff. Sorry, TheMan...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Problem with simple string function
    in C
    I would try to use char arrays, but maybe this is stupid/non-efficient let's see what the experts say......
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Problem with simple string function
    in C
    I do not know the string library included so I do not know if string is a valid return type (I thought you can only use char)...but what seems to be missing in all cases is that you do not include the header in the test1.cpp file...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to c++ code for inverse of NXN matrix
    in C
    I do not know if it is exists for general case. For the 2X2 matrix there is the gsl library. If you have matlab you can call matlab to invert the matrix from your c++ code......
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to How Do You Add Colored Code in the Forums
    in C
    Instead of typing only "code" in brackets at the beginning of your code you type "code=c"... for example
    Code:
    int i=0;
    for i= 0 ; i<4; i++
    {
    std::cout<<'this should have no colors'<<endl;
    }
    [code=c]
    int i=0;
    for (i= 0 ; i<4; i++)
    {
    std::cout<<'thi s should have colors'<<endl;
    }
    [/code]
    In case quote...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to C++ Rotating a square matrix 90 degrees
    in C
    For your first question doesn't he use GSL_matrix? Isn't there the matrix defined this way? Try to search for gsl matrix on the net.

    The second question works fine: just write a_{i,j}=b_{size-j-1,i} and make a few tries for i and j to convince that is right for example consider i=1=j so you see that input element is 55 (=b_{3-1-1,1}) exactly as the output a_{1,1}
    For i=1 j=2 you get a_{1,2} =b_{0,1} and b_{0,1}=44
    ...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to I need software to run my c++ programs
    in C
    It seems to me that if the program is compiled (without errors) you can run it everywhere (if there are no OS specific stuff in the code); I guess you need help with how to compile the programs you have written...

    On linux usually the compilers are shipped with, but in case look for gcc...

    In windows I do not know if there are free distributions, but I guess so, try to search on the net......
    See more | Go to post

    Leave a comment:


  • Have you tried to modify lines 13 to 19 with something like int i=0? As someone pointed out in a post?
    See more | Go to post

    Leave a comment:


  • How can it give outputs if you don't type anything?...
    See more | Go to post

    Leave a comment:


  • You get the error because you wrote the line 30,31,32 the wrong way around. In C++ a=b is not the same as b=a, former says a takes the value of b the latter b takes the value of a.
    What you want to do is to write m=j+k, etc. otherwise (as it is done now) you assign a non-defined value (m) to the sum j+k.
    Hope this helps...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Help required for C program
    in C
    Sorry for posting the code...

    Majestic if you post how you think to do it there will be surely people who help you see if your idea works...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Help required for C program
    in C
    What about making a while-for combination? i being the bulb where you start the iteration (i=2 first round, then i=3 etc) and n the bulb increased according to n where you have to switch. I would imagine it looks something like this
    [code=c]
    code removed
    [/code]
    But it won't work yet completely this way I guess, but it should help you get started......
    See more | Go to post
    Last edited by sicarie; Feb 28 '08, 02:21 PM. Reason: Posting Guidelines

    Leave a comment:


  • sanctus
    replied to All Combinations of a string
    in C
    Just to let you know: probably no one will answer you if you don't put a code saying where you are stuck and also it goes against the rule of this site to do the homework (in case it is one) for other people...
    See more | Go to post

    Leave a comment:


  • sanctus
    replied to Arrays
    in C
    Well, you create an array of integers of say 10 elements with
    Code:
    int a[10];
    you fill it with commands like
    Code:
    a[3]=2;
    So the forth (starts counting at zero) element is 2.

    I don't see why you need to delete an element, you just can give it another value (as long as it is not defined as constant). In case typing
    Code:
    a[3]='\0';
    seems to work but I don't guarantee that (I'm not sure about it)...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...