1. Post #1601
    false prophet's Avatar
    October 2011
    943 Posts
    There's an old project on Sourceforge that I've taken interest in, and I'm trying to convert it to C89. It's written in good ol' K&R (sometimes) and it has a lot of dependencies in DOS and Windows, so my next step is to make it portable. However, ANSI compliance of course comes first.

    I'm looking for a decent guide on porting; does anyone have one?

    In addition, I could also use some help with make. The makefiles included with the source are, of course, rather outdated and I don't have any experience with makefiles or the tool.
    Those goto's make me cringe.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #1602
    Hello all. I posted here before regarding my difficulties installing Microsoft Visual Studio (with an .exe file not working, and no alternatives functioning) earlier and ended up giving up. That was months ago, but damnit, I want to code. I'm not entirely sure why, but everytime I attempt to install ANY version of Microsoft Visual Studio, a .exe doesn't appear, no matter what, and no alternatives previously suggested have functioned. Does anyone know WHY it wouldn't be installing properly, or at the very least, have an idea? It's frustrating as hell to not be able to get passed the first page of my programming book.
    Reply With Quote Edit / Delete United States Show Events

  3. Post #1603
    Behemoth_PT's Avatar
    March 2007
    1,933 Posts
    I don't know if this can be really considered programing but I'm really in need of help in a project of mine in Xilinx.

    I don't know if this is the right place to do it, but I have an assignment to present next friday and I've been having issues with Xilinx 10.1.

    Now before you say anything about the outdated version, yes, it's the version we use at university and therefore it's the version I use too.

    So I've been making a multiplier in Digital Systems. We have a 2 bit A variable which will represent the number we want to successively sum (multiplicate) and a 3 bit B input which is the number we want to sum A B times.

    Then for outputs we have 6 bit C which is the result, a stop output and a OK output. Stop means the end of each sum and OK means the operation is complete.

    Problem is when testing the functionality of the design in the test wave bench, some outputs of the C variable present themselves in a red line with a U for "undefined".

    This is really driving me crazy since I have to program a CPLD board with this and it won't let me with this error.

    If this information is not enough I can post my work and work objectives so you can help me further. Either way, does anyone have any idea of what this is?

    Thank You!

    PS - If someone does get to help me, I will mention him on my assignment's report!
    Reply With Quote Edit / Delete Windows 7 Portugal Show Events

  4. Post #1604
    Gold Member
    Larikang's Avatar
    November 2005
    2,558 Posts
    Did you try -std=gnu++11
    So it turns out C++11 is enabled by default... except VS 2010 only has a handful of features implemented. And even 2012 doesn't have range-based for loops.

    Edited:

    Hello all. I posted here before regarding my difficulties installing Microsoft Visual Studio (with an .exe file not working, and no alternatives functioning) earlier and ended up giving up. That was months ago, but damnit, I want to code. I'm not entirely sure why, but everytime I attempt to install ANY version of Microsoft Visual Studio, a .exe doesn't appear, no matter what, and no alternatives previously suggested have functioned. Does anyone know WHY it wouldn't be installing properly, or at the very least, have an idea? It's frustrating as hell to not be able to get passed the first page of my programming book.
    There are alternatives.
    http://www.mingw.org/
    http://www.cygwin.com/
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1Useful Useful x 1 (list)

  5. Post #1605
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    9,823 Posts
    Yeah I do all of my Windows C++ with MinGW. Download CodeBlocks as an IDE (there's even a package on their site that includes MinGW and sets it up to work with CodeBlocks)

    Link: http://prdownload.berlios.de/codeblo...ingw-setup.exe
    Reply With Quote Edit / Delete Canada Show Events Useful Useful x 1 (list)

  6. Post #1606
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    Can anybody recommend a good SVN host?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  7. Post #1607

    January 2012
    416 Posts
    Can anybody recommend a good SVN host?
    Here!
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Dumb Dumb x 3Funny Funny x 1 (list)

  8. Post #1608
    Gold Member
    Loli's Avatar
    April 2008
    2,288 Posts
    Not helpful. I need to be able to access it around the country.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  9. Post #1609
    flayne's Avatar
    January 2011
    1,628 Posts
    Can anybody recommend a good SVN host?
    Google Code perhaps?
    http://code.google.com/hosting/createProject

    Edited:

    Hello all. I posted here before regarding my difficulties installing Microsoft Visual Studio (with an .exe file not working, and no alternatives functioning) earlier and ended up giving up. That was months ago, but damnit, I want to code. I'm not entirely sure why, but everytime I attempt to install ANY version of Microsoft Visual Studio, a .exe doesn't appear, no matter what, and no alternatives previously suggested have functioned. Does anyone know WHY it wouldn't be installing properly, or at the very least, have an idea? It's frustrating as hell to not be able to get passed the first page of my programming book.
    Worse case scenario you can always just use a different compiler like Dev-C++ or GCC. Although its very strange that you're having issues installing Visual the executable should be located in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" for 64-bit OS or "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" for 32-bit OS if you used the default directory.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #1610
    Gold Member
    esalaka's Avatar
    July 2007
    10,130 Posts
    Or Assembla. I think they even offer you one non-public repository for free nowadays.
    Reply With Quote Edit / Delete Linux Finland Show Events

  11. Post #1611
    [SUB][SUB][SUB][SUB]

    Well well, CodeBlocks appears to be functioning. Yes, flayne, it is certainly odd, but if I knew the cause then it wouldn't be a problem would it?

    Time to crack open this book an have at it. I'll probably be asking a shitton of questions the coming hours, but hell, I'm excited, so let's have a go!

    Edited:

    Worse case scenario you can always just use a different compiler like Dev-C++ or GCC. Although its very strange that you're having issues installing Visual the executable should be located in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" for 64-bit OS or "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" for 32-bit OS if you used the default directory.
    oh

    i'm retarded

    but it says



    soooo

    and this is a big problem because lo and behold, my programming book requires I use visual studio

    motherfucker

    help :(

    Edited:

    actually hang on

    I think it's working

    I'm sorry for clogging up the thread, but I'm still absolutely braindead onto how these things function [/SUB][/SUB][/SUB][/SUB]

    Edited:



    Mmph.

    Sorry being retarded, guys. I'll try to post ACTUAL QUESTIONS next time.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #1612
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,685 Posts
    NateDude, you've reached the same point of why I ditched windows and went to Linux. I was really glad I did so, if you add me on steam I can help you start developing on Linux.

    It's an excellent C++ development environment.

    Edited:

    Oh, although I didn't get my application working like you did. The only solution was to re-install windows.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Friendly Friendly x 2Disagree Disagree x 1 (list)

  13. Post #1613
    It's apparently C++ instead of C#

    God fucking damnit

    Edited:



    ;_;

    can anyone who knows how they got it to work add me on steam and help? It won't work mooootherfuuuucker

    Edit: wow apparently puu.sh can't read errors

    here we are


    Still, motherFUCK

    If anyone knows how to fix this it would be really appreciated right now
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  14. Post #1614
    ichiman94's Avatar
    August 2010
    857 Posts
    Does anyone know a good Compression lib under .Net that has good documentation and can store multiple files inside one archive and gives Streams for each compressed file inside the archive? I want to make an asset framework so if I want to add additionial informations for images I won't end up with two file just for 1 sprite.
    Reply With Quote Edit / Delete Hungary Show Events

  15. Post #1615
    MickeyCantor's Avatar
    May 2012
    44 Posts
    Does anyone know the best place to learn openGL, i asked in the last thread but no one gave me a response
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #1616

    January 2012
    132 Posts
    Does anyone know the best place to learn openGL, i asked in the last thread but no one gave me a response
    open.gl (duh)
    This question was asked a thousand times
    Reply With Quote Edit / Delete Windows XP Russian Federation Show Events Friendly Friendly x 2Funny Funny x 1Zing Zing x 1 (list)

  17. Post #1617
    MickeyCantor's Avatar
    May 2012
    44 Posts
    not gonna lie, that was clever
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  18. Post #1618
    halofreak472's Avatar
    August 2009
    360 Posts
    Will Objective-C compilers compile unmodified C code? Everyone I ask gives me a different answer.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #1619
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    9,823 Posts
    Will Objective-C compilers compile unmodified C code? Everyone I ask gives me a different answer.
    Who's telling you it won't? They're idiots.

    Objective-C is a thin layer on top of C, and moreover is a
    strict superset of C; it is possible to compile any C program
    with an Objective-C compiler, and to freely include C code
    within an Objective-C class.
    via Wikipedia
    Reply With Quote Edit / Delete Canada Show Events Agree Agree x 1 (list)

  20. Post #1620
    Tinker Toy's Avatar
    February 2012
    148 Posts
    Those goto's make me cringe.
    Yep, the project is, well, sort of a mess. That's one of the prime reasons I'm trying to do a little fixing up. ;)
    Again, any good resources on converting K&R to ANSI?
    Reply With Quote Edit / Delete Linux United States Show Events

  21. Post #1621
    Gold Member
    esalaka's Avatar
    July 2007
    10,130 Posts
    Will Objective-C compilers compile unmodified C code? Everyone I ask gives me a different answer.
    At least at some point in time Obj-C compilers were just C compilers with an Obj-C preprocessor on top.
    Reply With Quote Edit / Delete Linux Finland Show Events

  22. Post #1622
    rute's Avatar
    August 2009
    212 Posts
    How to rotate object around it's center?
    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
    
    private float rot;
    
    function draw(GL10 gl)
    {
    	gl.glPushMatrix();
    	gl.glRotatef(rot, 0, 0, 1);
    	rot+=1;
    	// Drawing goes here...
    	gl.glPopMatrix();
    }
    
    This makes it rotate around map origin.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  23. Post #1623
    Gold Member
    esalaka's Avatar
    July 2007
    10,130 Posts
    Aren't you just rotating everything around [0, 0, 0] there?
    Reply With Quote Edit / Delete Linux Finland Show Events Agree Agree x 1 (list)

  24. Post #1624
    AlienCat's Avatar
    October 2011
    508 Posts
    How to rotate object around it's center?
    Translate the object to 0, 0, 0 (some padding might be needed, not sure), do the rotation and translate back.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 1Informative Informative x 1 (list)

  25. Post #1625
    I gave enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,404 Posts
    -oh wait, snip-
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  26. Post #1626
    hogofwar's Avatar
    May 2008
    4,724 Posts
    I am using Java.

    I have a game that needs to write to and get data from a database (mysql to be precise), I currently have a PHP file on my webserver that acts as a middleman and only does the specific actions required.

    The problem I have is that people can still directly find the web page and abuse it by submitting fake data. It's not hard to find it when decompiling the java.

    Is there any good ways to secure the connection a bit more?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  27. Post #1627
    rute's Avatar
    August 2009
    212 Posts
    Translate the object to 0, 0, 0 (some padding might be needed, not sure), do the rotation and translate back.
    This made it disappear.
    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
     
    private float rot;
     
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(0, 0, -1); // Translated to 0.
        gl.glRotatef(rot, 0, 0, 1);
        gl.glTranslatef(x, y, -1); // Translated back.
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }
    
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  28. Post #1628
    NovembrDobby's Avatar
    April 2007
    1,147 Posts
    This made it disappear.
    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
     
    private float rot;
     
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(0, 0, -1); // Translated to 0.
        gl.glRotatef(rot, 0, 0, 1);
        gl.glTranslatef(x, y, -1); // Translated back.
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }
    
    I may be wrong but I think you need to pass in relative co-ordinates to glTranslatef, the first one you're using doesn't actually do anything because you passed in 0, 0.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #1629
    Gold Member

    March 2005
    3,028 Posts
    Those goto's make me cringe.
    I took a look at a few random source file to see if they were even 'bad' gotos, and I didn't see an instance of anything that was more than a minor ideological concern.
    Reply With Quote Edit / Delete Windows 7 Show Events

  30. Post #1630
    Gold Member
    hexpunK's Avatar
    August 2008
    15,312 Posts
    I am using Java.

    I have a game that needs to write to and get data from a database (mysql to be precise), I currently have a PHP file on my webserver that acts as a middleman and only does the specific actions required.

    The problem I have is that people can still directly find the web page and abuse it by submitting fake data. It's not hard to find it when decompiling the java.

    Is there any good ways to secure the connection a bit more?
    I would say look into Java Servlets, then stick the required page in the WEB-INF directory, stopping external access to it. But why are you relying on PHP to get some data from the Database when you could do it in Java?

    And then, if you are worried about people getting access to your database by looking at the decompiled Java, just create a user on the database with minimal rights required (SELECT only perhaps?) and use that rather than one with all the rights.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  31. Post #1631
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,685 Posts
    This made it disappear.
    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
     
    private float rot;
     
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(0, 0, -1); // Translated to 0.
        gl.glRotatef(rot, 0, 0, 1);
        gl.glTranslatef(x, y, -1); // Translated back.
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }
    
    Do this instead:

    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
     
    private float rot;
     
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(x, y, 0); // Translated to 0.
        gl.glRotatef(rot, 0, 0, 1);
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }

    Make sure your drawing calls are drawing at the origin though.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #1632
    flayne's Avatar
    January 2011
    1,628 Posts
    Does anyone know the best place to learn openGL, i asked in the last thread but no one gave me a response
    Get the OpenGL Superbible.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 1 (list)

  33. Post #1633
    MickeyCantor's Avatar
    May 2012
    44 Posts
    Get the OpenGL Superbible.
    Actually i have tried to use that, some of the code took reworking to compile on VS2010, they don't have the updated lib's for 2010, and they also restrict you to using their lib "GLTools" and im not a fan of that
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #1634
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    Actually i have tried to use that, some of the code took reworking to compile on VS2010, they don't have the updated lib's for 2010, and they also restrict you to using their lib "GLTools" and im not a fan of that
    GLTools is only really used for the first few chapters as a way to introduce OpenGL concepts before introducing the API itself (which can seem pretty daunting if you're an absolute beginner). I have the book and I absolutely love it for the last 2/3 of the book which very cleanly explains how to do some of the things that I have a hard time finding solutions to on the internet.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #1635
    MickeyCantor's Avatar
    May 2012
    44 Posts
    GLTools is only really used for the first few chapters as a way to introduce OpenGL concepts before introducing the API itself (which can seem pretty daunting if you're an absolute beginner). I have the book and I absolutely love it for the last 2/3 of the book which very cleanly explains how to do some of the things that I have a hard time finding solutions to on the internet.
    i mean i can give it another try, but i have to jump through hoops to get it to compile on VC 10
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  36. Post #1636
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    i mean i can give it another try, but i have to jump through hoops to get it to compile on VC 10
    If it's difficult to get it to work on VS2010, then learn the basics from one of the many great online tutorials for beginners. The stuff you find later in the book is very useful IMO, and having a physical copy of the OpenGL man pages is also very handy.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  37. Post #1637
    Lemons in Bulk
    Cakebatyr's Avatar
    May 2005
    5,059 Posts
    (Now with the correct thread!)

    So I've begun working on an android app that does all calculations related to first year chemistry.

    I've got most of the methods handling formulae down and complete, but I've run into a wall with building the UI.

    Here is what it currently looks like, but I haven't really touched it since I'm unsure how to proceed. I'm very unsatisfied with my layout since I'm not sure how my layout should be shown.

    It looks a lot better on a 10" tablet (and landscape in general) where I have actually made headway due to the extra screen real estate allowing me more room to put stuff per group of elements, but the phone side of the GUI is stopping me dead.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  38. Post #1638
    Team Hamster
    Mordi's Avatar
    January 2012
    312 Posts
    Do I need a mac to develop an iPhone app, or can it be done on windows (without jailbreaking my phone)?

    Edited:

    Actually i have tried to use that, some of the code took reworking to compile on VS2010, they don't have the updated lib's for 2010, and they also restrict you to using their lib "GLTools" and im not a fan of that
    I initially used this book, and as you say it is quite outdated, and it also uses an inferior library for context/window-handling. I had to switch to a better one, but I did learn quite a lot from the book itself. I only read the first few chapters, though...
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  39. Post #1639
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Do I need a mac to develop an iPhone app, or can it be done on windows (without jailbreaking my phone)?
    I can't speak from experience, but I think there are several platforms for developing apps on Windows (e.g. Adobe AIR). It is only possible to submit an app to the app store on a Mac though.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 2 (list)

  40. Post #1640
    rute's Avatar
    August 2009
    212 Posts
    Do this instead:

    //position.
    private float x = 50;
    private float y = 100;
    private float width = 50;
    private float height = 50;
     
    private float rot;
     
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(x, y, 0); // Translated to 0.
        gl.glRotatef(rot, 0, 0, 1);
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }

    Make sure your drawing calls are drawing at the origin though.
    It works now, thank you!

    However it rotated around it's left corner so i had to do this:
    function draw(GL10 gl)
    {
        gl.glPushMatrix();
        gl.glTranslatef(x+(width/2), y+(height/2), 0); // Translate to center.
        gl.glRotatef(rot, 0, 0, 1);
        gl.glTranslatef(x, y, 0); // Translate back.
        rot+=1;
        // Drawing goes here...
        gl.glPopMatrix();
    }
    
    But now it likes to disappear again...
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Funny Funny x 1 (list)