1. Post #2081
    kill yourself
    Protocol7's Avatar
    June 2006
    26,076 Posts
    I figured that syntax would be similar enough but actual function implementation and class declaration and all the runtime stuff would be completely different. Sure glad I don't have to deal with con/destructor though.

    I'll write a few hello worlds to get used to it, then tackle my desired app.
    Reply With Quote Edit / Delete United States Show Events Programming King Programming King x 1 (list)

  2. Post #2082
    Map in a box's Avatar
    July 2009
    7,409 Posts
    public class Dicks{
        public static void main(String[] args){
            System.out.println("Milliseconds since the Unix Epoch: "+System.currentTimeMillis());
        }
    }
    
    One thing I dislike about Java: NO OPERATOR OVERLOADS GRR
    Reply With Quote Edit / Delete Windows XP United States Show Events Agree Agree x 15Friendly Friendly x 1Dumb Dumb x 1Programming King Programming King x 1 (list)

  3. Post #2083
    Gold Member
    ThePuska's Avatar
    October 2005
    3,440 Posts
    I made a quick and dirty program to draw images as text.

    Reply With Quote Edit / Delete Windows 7 Finland Show Events Artistic Artistic x 51Programming King Programming King x 4Winner Winner x 3 (list)

  4. Post #2084
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Not trying to hate but the codebase would become a leaky mess in just a few people's turns. I don't mean it in a dick way, but I've been working on learning C for a while and I still wouldn't be comfortable writing code others are going to work extensively with.
    http://www.hpl.hp.com/personal/Hans_Boehm/gc/

    Edited:

    it works brilliantly, i've used it in a few projects

    Edited:

    just replace all your malloc() calls to GC_MALLOC(), all your realloc() calls to GC_REALLOC() and remove your calls to free()
    Reply With Quote Edit / Delete Mac Australia Show Events Programming King Programming King x 1 (list)

  5. Post #2085
    garry's Avatar
    September 2001
    12,432 Posts
    Decided to pick up my C++ project again. I haven't written any code for a while.


    I decided that the first thing I'd do is plug my console library into GWEN. Was surprisingly easy, and more astoundingly my old code works

    Can someone explain GWEN_CONTROL_INLINE to me? I can't figure out how it works, only how it's used.
    I tried to minimize the usage of macros in GWEN, but there are a few that should probably be better documented.

    // To be placed in the controls .h definition.
    #define GWEN_CONTROL( ThisName, BaseName )\
    	public:\
    	typedef BaseName BaseClass;\
    	typedef ThisName ThisClass;\
    	GWEN_DYNAMIC( ThisName, BaseName )\
    	ThisName( Gwen::Controls::Base* pParent, const Gwen::String& pName = "" )
    
    #define GWEN_CONTROL_INLINE( ThisName, BaseName )\
    	GWEN_CONTROL( ThisName, BaseName ) : BaseClass( pParent, pName )
    
    #define GWEN_CONTROL_CONSTRUCTOR( ThisName )\
    	ThisName::ThisName( Gwen::Controls::Base* pParent, const Gwen::String& pName ) : BaseClass( pParent, pName )

    So as you can see GWEN_CONTROL_INLINE calls GWEN_CONTROL.. which...

    typedef's BaseClass to whatever your baseclass is (so in code you can do things like BaseClass::Function()).

    typedef's ThisClass to whatever your class is (so you can do ThisClass::BlahBlah - for example when passing hooking up events).

    GWEN_DYNAMIC just sets some stuff up to allow for safe typecasting when dynamic_cast isn't available (using gwen_cast)

    And then it creates the constructor line.

    Normally you'd use GWEN_CONTROL_INLINE if you were defining the classes constructor in your the class definition. Otherwide you'd use GWEN_CONTROL in your header, and GWEN_CONTROL_CONSTRUCTOR in your body.
    Reply With Quote Edit / Delete Windows 7 Show Events Informative Informative x 1Programming King Programming King x 1 (list)

  6. Post #2086
    CJF
    PieClock's Avatar
    August 2006
    16,431 Posts
    Multiple frame importing from spritesheets:



    The frames don't go in the right order but that's an easy fix.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 26Programming King Programming King x 2Useful Useful x 1 (list)

  7. Post #2087
    Gold Member
    ralle105's Avatar
    October 2005
    4,648 Posts
    public class Dicks{
        public static void main(String[] args){
            System.out.println("Milliseconds since the Unix Epoch: "+System.currentTimeMillis());
        }
    }
    
    One thing I dislike about Java: NO OPERATOR OVERLOADS GRR
    This and typedefs would make java so much easier to use.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Disagree Disagree x 1Agree Agree x 1Programming King Programming King x 1 (list)

  8. Post #2088
    Hates php
    high's Avatar
    May 2006
    2,415 Posts
    public class Dicks{
        public static void main(String[] args){
            System.out.println("Milliseconds since the Unix Epoch: "+System.currentTimeMillis());
        }
    }
    
    One thing I dislike about Java: NO OPERATOR OVERLOADS GRR
    Would be nice but there are other bigger reasons to dislike Java. Honestly in C# I never use operator overloading.

    Edited:

    Just thought of a nice project to do for my portfolio. Going to create an asp.net service for error reporting which automatically creates new issues on GitHub.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 2Agree Agree x 1Programming King Programming King x 1 (list)

  9. Post #2089
    Tamschi's Avatar
    December 2009
    3,605 Posts
    Would be nice but there are other bigger reasons to dislike Java. Honestly in C# I never use operator overloading.
    It's extremely useful for some of the built-in types though.
    The things that annoy me are no generics for value types, no initializers and no extension methods.

    A co-worker showed me {{}} "initializers", but those are usually not a good idea.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Programming King Programming King x 1 (list)

  10. Post #2090
    Gold Member
    Darwin226's Avatar
    January 2009
    4,157 Posts
    Multiple frame importing from spritesheets:



    The frames don't go in the right order but that's an easy fix.
    Not sure if someone asked before, but what theme is that? (And the wallpaper)
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 2Programming King Programming King x 1 (list)

  11. Post #2091
    alexaz's Avatar
    October 2010
    298 Posts



    Which background should i use for a login screen?
    Reply With Quote Edit / Delete Windows 7 Lithuania Show Events Artistic Artistic x 3Programming King Programming King x 1 (list)

  12. Post #2092
    Which background should i use for a login screen?
    First one
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Agree Agree x 14Programming King Programming King x 1 (list)

  13. Post #2093
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    In the past 2 days I've been working on recreating the rating list on the old Facepunch. It just started working and I'm currently testing it with people on the forums.This project wasn't as technically involved as WebCraft, but it was a nice little challenge nonetheless.



    What to do when you need the ratings of every post on Facepunch without access to the database? It would be a lot more tricky on other forums, but luckily Facepunch gives us a head start by providing the ticker. The ticker informs us of new posts being made on the forum, so we don't need to scrape every subforum and every thread. We can now build a list of posts:



    As you can see, the ticker gives us all the information we need to fill this table in:



    The rest would seem easy, we just send a request for the rating list for every collected post id. There is also the problem that every rating list request will capture just what happened up until that time. If someone rates the post after that, it will not be recorded. The solution is to give users a reasonable time frame to rate a post before requesting the rating list. We could simply wait a month before collecting the ratings of each post, but then the displayed statistics wouldn't be very interesting. The challenge here is to find a balance between a reasonable rating time frame and a reasonable update delay. I've set that delay at 24 hours right now. That means that if your post gets rated now, the rating will have been added to your list tomorrow and if anyone rates your post after that, it will not be recorded.

    Initially I had in mind that at 0:00 GMT every day, a cronjob would come along and collect all ratings of posts from 24 hours ago and earlier. This turned out to be not very feasible when I discovered that users on Facepunch write no less than 15 thousand new posts every day. So, instead I merged the ticker listening script with the rating scraper. Instead of doing it all at once, it collects the rating of ~4 posts every 10 seconds.



    In the past 39 hours, this has already resulted in an large amount of data:



    Luckily collecting the data was the hardest part of this project and retrieving statistics is simple. A few examples are listed below:

    User with the most ratings?



    Who did garry rate?

    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Winner Winner x 11Programming King Programming King x 6Useful Useful x 2 (list)

  14. Post #2094
    Gold Member
    toaster468's Avatar
    January 2010
    3,259 Posts
    More of that I kinda told my parents that it was 18 or older before I noticed that it doesn't ask for a DoB and it wouldn't matter. So if I did make an app and got a playbook in the mail, they'd know something was up.

    Edited:

    So go nuts
    Ok, so I guess I'll use it then, thank you.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 1 (list)

  15. Post #2095
    CJF
    PieClock's Avatar
    August 2006
    16,431 Posts
    Not sure if someone asked before, but what theme is that? (And the wallpaper)
    Theme is Soft 7, you can find it on Deviant Art and I'll leave a profile message with a link the the wallpaper when I get back on my Desktop if I remember.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1Programming King Programming King x 1 (list)

  16. Post #2096
    Paid for a title.
    Maurice's Avatar
    June 2005
    6,175 Posts
    And I actually implemented this thing into the game now, only works with that hat. I also made it kill all the enemies on the screen.

    Bowser didn't stand a chance.
    And to think, I could be doing something productive with my time!
    Reply With Quote Edit / Delete Windows Vista Germany Show Events Optimistic x 10Winner x 2Funny x 1Friendly x 1Programming King x 1 (list)

  17. Post #2097
    And I actually implemented this thing into the game now, only works with that hat. I also made it kill all the enemies on the screen.

    Bowser didn't stand a chance.
    And to think, I could be doing something productive with my time!
    Now make a double rainbow

    Edited:

    Only for that hat
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Programming King Programming King x 1 (list)

  18. Post #2098
    Gold Member
    Dryvnt's Avatar
    February 2008
    1,763 Posts
    And I actually implemented this thing into the game now, only works with that hat. I also made it kill all the enemies on the screen.

    Bowser didn't stand a chance.
    And to think, I could be doing something productive with my time!
    Wait... Does it go back in time?
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Programming King Programming King x 1 (list)

  19. Post #2099
    Paid for a title.
    Maurice's Avatar
    June 2005
    6,175 Posts
    Now make a double rainbow
    Reply With Quote Edit / Delete Windows Vista Germany Show Events Optimistic Optimistic x 16Programming King Programming King x 5Winner Winner x 4Artistic Artistic x 1 (list)

  20. Post #2100
    I mean in the background but okay

    Edited:

    By the way, what do you use for screen recording?
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Programming King Programming King x 1 (list)

  21. Post #2101
    Paid for a title.
    Maurice's Avatar
    June 2005
    6,175 Posts
    I mean in the background but okay

    Edited:

    By the way, what do you use for screen recording?
    CamStudio

    I slow down the game to about 70% so I get a decent framerate though (lossless quality is slow)
    Reply With Quote Edit / Delete Windows Vista Germany Show Events Funny Funny x 1Programming King Programming King x 1 (list)

  22. Post #2102
    Hruhf's Avatar
    September 2007
    625 Posts
    Starting Engineering at university in a couple of weeks, read the syllabus for my unit titled "Engineering: Programming", apparently our starting language is going to be C.

    Kinda glad since this is only the common first year of engineering and they're not teaching something like visual basic.

    Let's just hope they aren't lying.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Programming King Programming King x 2 (list)

  23. Post #2103
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,502 Posts
    maybe if I post some content I'll be more motivated to work on it



    I'm working on this again. Complete rewrite in Lua + LÖVE, much, much cleaner code and overall more brilliant. Haven't got half the features I had before yet though.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 2Artistic Artistic x 2Programming King Programming King x 1 (list)

  24. Post #2104
    I made WAYWO a better place
    OldFusion's Avatar
    September 2011
    1,311 Posts
    I made a quick and dirty program to draw images as text.

    Here is my go at it from a while ago.



    Lol: http://cold.netburst.co.uk/file/background.png
    Reply With Quote Edit / Delete Windows 7 United States Show Events Artistic Artistic x 3Programming King Programming King x 2 (list)

  25. Post #2105
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Making an electronics thing.



    Don't mind the programmer art. Any thoughts on how to save space on large gates but look nice?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 1 (list)

  26. Post #2106
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Rather than make a sarcastic poke at my title again, I wanted to tell you I really enjoy your work. I hope you keep working on Mari0 and it gets more attention in the future than it already has.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Friendly Friendly x 1Funny Funny x 1Programming King Programming King x 1 (list)

  27. Post #2107
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    4,071 Posts


    I can now generate rooms with

    GenerateRoom(3, new Vector2(0,200));

    means: Generate a 3x3 (ground) room at pos X=0, Y=200.

    Note that the torch at the player is not completed yet.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Winner Winner x 3Programming King Programming King x 1 (list)

  28. Post #2108
    calzoneman's Avatar
    February 2008
    460 Posts
    Multiple frame importing from spritesheets:



    The frames don't go in the right order but that's an easy fix.
    Not sure if I'm late, but any plans for releasing this?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1Programming King Programming King x 1 (list)

  29. Post #2109
    Gold Member
    Smashmaster's Avatar
    April 2005
    1,549 Posts
    I wonder how many hours @@ has spent rating everyone programming kings so far.

    EDIT: (Or if he's using the API and a bot)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 13Programming King Programming King x 2 (list)

  30. Post #2110
    I gave ••••• enough money to buy a soda.
    Funley's Avatar
    May 2010
    1,425 Posts
    I made a quick and dirty program to draw images as text.

    Now do a text image of that image and a text image of the image from the first image-to-text conversion.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Programming King Programming King x 1 (list)

  31. Post #2111
    @@
    @@'s Avatar
    January 2012
    138 Posts
    I wonder how many hours @@ has spent rating everyone programming kings so far.
    I used Andrew/Stoned/GranPC's Lua API for the first 50 pages. For the rest I just hit programming king button as I read.

    (User was permabanned for this post ("Fuck off" - garry))
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 30Funny Funny x 7 (list)

  32. Post #2112
    Person
    geel9's Avatar
    June 2008
    5,732 Posts
    I used Andrew/Stoned/GranPC's Lua API for the first 50 pages. For the rest I just hit programming king button as I read.
    You realize that that's bannable right?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 3Programming King Programming King x 1 (list)

  33. Post #2113
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,502 Posts
    You realize that that's bannable right?
    only if you're deloc
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 9Programming King Programming King x 1 (list)

  34. Post #2114
    Ask Rohan about rust keys!
    Bumrang's Avatar
    August 2011
    2,849 Posts
    You realize that that's bannable right?
    But the mods haven't banned him yet so I think they are fine with it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 2Funny Funny x 1 (list)

  35. Post #2115
    www.bff-hab.de
    Dennab
    February 2009
    7,832 Posts
    You realize that that's bannable right?
    Also it's annoying and retarded
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 19Programming King Programming King x 2Disagree Disagree x 2 (list)

  36. Post #2116
    Tobba.'s Avatar
    February 2012
    17 Posts
    Disassembled, Skyrim's code is full of gems, like this function

    Code:
    00561420  push        ebp  
    00561421  mov         ebp,esp  
    00561423  push        ecx  
    00561424  mov         dword ptr [ebp-4],ecx  
    00561427  mov         eax,dword ptr [ebp-4]  
    0056142A  mov         eax,dword ptr [eax+4]  
    0056142D  mov         esp,ebp  
    0056142F  pop         ebp  
    00561430  ret
    A++ compiler
    it doesnt even use leave
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Funny Funny x 11Programming King Programming King x 2 (list)

  37. Post #2117
    Gold Member
    Bluefire's Avatar
    August 2007
    323 Posts
    I made a quick and dirty program to draw images as text.

    [SHODAN]
    Dammit. There goes my goal of doing something productive and actually finishing my project I was coding.

    System Shock 2 time.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Programming King Programming King x 2 (list)

  38. Post #2118
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Disassembled, Skyrim's code is full of gems, like this function

    Code:
    00561420  push        ebp  
    00561421  mov         ebp,esp  
    00561423  push        ecx  
    00561424  mov         dword ptr [ebp-4],ecx  
    00561427  mov         eax,dword ptr [ebp-4]  
    0056142A  mov         eax,dword ptr [eax+4]  
    0056142D  mov         esp,ebp  
    0056142F  pop         ebp  
    00561430  ret
    A++ compiler
    it doesnt even use leave
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Funny Funny x 32Agree Agree x 5Programming King Programming King x 1 (list)

  39. Post #2119
    Ask Rohan about rust keys!
    Bumrang's Avatar
    August 2011
    2,849 Posts


    Progress!
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 3 (list)

  40. Post #2120
    AntonioR's Avatar
    April 2011
    1,224 Posts
    Facepunch game programming competition #5 (WIP)

    Reply With Quote Edit / Delete Windows XP Croatia Show Events Artistic Artistic x 6Programming King Programming King x 2 (list)