GN90

  • Dec 25, 2012
  • Joined Oct 7, 2009
  • I don't know if the title is clear, but here's the problem.

    I doing a small game/rendering engine for my 3D programming class and I have to implement basic controls to enable/disable certain features : different types of lighting, shadow, normal mapping, controlling an avatar, camera, ... and to edit the terrain I made a basic terrain editor where i can insert objects, alter the heightmap, .... . So i have 2 controll modes (normal and sceen editor) and stuff to controll.
    I started managing them with a nasty block of switch than had to make an if else but it is annoying me. It is so ugly to in see that big if else code and it is getting annoying to maintain and change the controls as more stuff are being added.

    so my idea is to make a simple structure containing :
    - the control name
    - vector of pointers to function that should be executed.
    and then with a simple loop i can remove that ugly block.

    the problem is the function does not have the same number of parameters or the same type. so for example making a vector of (void)(*func)(int) won't work.
    so is there anyway to make a pointer to a random function in c++ ? or solve this problem in a different way ?
  • Theory of Computation is basically the theoretical aspect of CS, you forget that you work on PC's or computers and you go back to the idea that programming is making calculations in an automatic ways. So they will explain to you what are the different methods of automatic calculations (while-loop, recursive functions, Turing machines, ....). So if you have a problem and you want to program it (calculate it) you have to be able to calculate using the calculation methods (that's programming) and you will find out that there are lots of programs that you cannot find a solution for them no matter what ... so the purpose is to give you the skills that if you have a problem and want to program to ask yourself the questions : should i bother search for an algorithm or no (cause it does not exist). and the second part you focus of the complexity theory (P, NP, NP-complete type problems) and i don't know how far they will go for you but had this course this year (first year of Masters) and it was hard, looooooooooooooooots of math, thought problems - especially when they use graph problems.
    You will feel in this course that you are in some math course not the usual CS course where you have to work on programs and stuff like that.

    It is useful, if someday you are working on complex algorithms, very complex problems (AI, Computer Vision, Robotics, .....) or optimization (to know how far can you optimize it, you will be able to reply for this question :"should i bother search for a more optimal solution or there no way i can find one even i search for a million year ?") if not [use it], well it is something you must learn because it reminds you that CS is basically applied math (usually pple forget that and can't see the link between CS and math) and it is a good training for your brain.
  • get used to Ubuntu (or any other Linux) and compiling with gcc and using a command-line debugger such as gdb and a bit of Emacs. Just from a personal experience even if VS is awesome, simple to debug, one click to compile, .... , but there will be the time where you must use to other stuff. When I was at uni in Leb well for the simplicity we tended to use VS, Borland, ... and other IDE's because of their simplicity and no one obliged me to use linux; out of curiosity i wen beyond our usual simple linux command course but i didn't get lots of practice with all the command-line development things. When i moved to to my new University well all the PCs have Linux installed, no windows, all the C/C++ development was made using emacs, and compiled with gcc, ..... . And I had to be the fool for the first couple of hours as i finish my assignments but don't know how to write the makefile in order to compile or like i had this bug and had no idea how to debugg it, and i had to spend like a week reading tutorials and documentation and testing just to catch up.
    So get used to it, even if you prefer the VS , it might be helpful someday and it might distinguish you from others (in your future job perhaps) .
  • your scanf is wrong; scanf variable's address so their values can change.
    should be : scanf(".. bla ..", &H1, &M1, &S1);
  • gravity is less on higher altitudes so time pass slower on the beach :P explains the 2 min difference lool
  • collectionIndex = rowIndex/2 + 1
    results will be :
    rowIndex ===> collectionIndex
    1 ===> 1
    3 ===> 2
    5 ===> 3
    7 ===> 4
    9 ===> 5
    11 ===> 6
    13 ===> 7
    15 ===> 8
    ......
  • i don't know if i got what you mean.
    so you have items in rows 1, 3 , 5 , 7 .... of the grid
    and rows 0/1 , 2/3, 4/5, .... corresponds to index 0, 1, 2, ... of the collection
    so when you click on 1 if should go to 0 , on 3 to 1, 5 to 2, ??
  • AVOlio wroteSeriously Guys, no one? thats weird
    hehe no, I went to fanar and did CS for past three years, now moved to France for masters. Too bad not a fanar student anymore. so i think your on your own now.
  • it is never about the uni, it will always be about the student. A curious; motivated student will make something out of his life no matter where he learned, what he learned or who taught him.
  • was on fedora now moved to ubuntu, but i use windows too.
  • Brevet : 13.21
    Terminal SG : 10.xxx
    Terminal S option Math (bac fr) : 12.5
    Uni (licence) : 15
  • Disneys Soundtracks (Aladin, tarzan, The Lion King, ....)
  • - the bathroom helps me finding answers (i guess reading this does not make me the only one :P).
    - when i solve something i stand up and go to either the bathroom or the kitchen to then remember that i wanted nothing.
    - when i solve something hard/or trying a new thing i kinda hate to continue with the small important details.
    - lots of azerty keyboards around me these days so i hate it :P, and i always curse when im on one.
    - I dream about solutions, and i can see line of codes in my head during the day when i have something hard to do.
    - I put music on and after a while i forget that it is playing.
  • Toy Story 1, 2 & 3
    Ratatouille
    Finding Nemo
    UP
    Wall-E
    (all pixar's movie except for Cars 2)

    The shawshank redemption
    Shindler's List
    Requiem for A Dream
    Psycho
    Lord of the Rings (all of them)
    Saving Private Ryan
  • i will taste fast internet next week as i move to Bordeaux :)
  • BS in Computer Science from UL - Fanar
    Moving to Bordeaux (France) next week for masters in image & sound processing (research type of master)
    Will finish this week my internship @ SES - sabis educational services.

    got interested in computers through video game as im a video game addict. Decided to get into CS cause i wanted to fix some irritating bug in my favorite game.
    Learned C++ and pascal in school but never practiced them and i really started sitting long ours looking at a code last year.
    I am interested in messing with low level (no abstraction) programing, and anything that needs experiments and not business oriented (stock management, ..... ).
    I rather prefer building a framework or a new library than making an application unless that application is a game.
    I hope to start coding the games i have on my notebook, my first attempt was a failure :P