1. Post #2121
    Tobba.'s Avatar
    February 2012
    17 Posts
    Code:
    00561480  push        ebp  
    00561481  mov         ebp,esp  
    00561483  push        ecx  
    00561484  mov         dword ptr [ebp-4],ecx  
    00561487  mov         ecx,dword ptr [ebp-4]  
    0056148A  call        005614A0  
    0056148F  mov         esp,ebp  
    00561491  pop         ebp  
    00561492  ret
    Oh god my sides

    yes we're still in the territory of laughing at circuit boards
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Funny Funny x 11Programming King Programming King x 2 (list)

  2. Post #2122
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    jesus, it's like an actually funny big bang theory

    that's not fair to say though; you can't compare the two because big bang theory is a total shitrag
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 18Dumb Dumb x 14Programming King Programming King x 1 (list)

  3. Post #2123
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,693 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
    That code is perfectly valid, and is more or less exactly what you would get from MSVC.

    Furthermore, enter and leave generally take up more cycles than the push/move/pop sequence.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Programming King Programming King x 2Agree Agree x 1Funny Funny x 1 (list)

  4. Post #2124
    Tobba.'s Avatar
    February 2012
    17 Posts
    That code is perfectly valid, and is more or less exactly what you would get from MSVC.
    Its perfectly valid, but it looks like someone set their optimization level to -3

    The entire function could be inlined with just mov eax, [ecx + 4]
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Informative Informative x 1Zing Zing x 1Winner Winner x 1Programming King Programming King x 1 (list)

  5. Post #2125
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Facepunch game programming competition #5 (WIP)

    You win.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 2Agree Agree x 1Programming King Programming King x 1 (list)

  6. Post #2126
    C:\
    C:\'s Avatar
    March 2011
    1,749 Posts
    @@ stop rating everyone programming king or you will be the next efex
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Disagree x 8Zing x 1Agree x 1Funny x 1Programming King x 1 (list)

  7. Post #2127
    @@
    @@'s Avatar
    January 2012
    138 Posts
    @@ stop rating everyone programming king or you will be the next efex
    you're worse then agop, can't accept a compliment.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 12Programming King Programming King x 4Dumb Dumb x 2 (list)

  8. Post #2128
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    jesus, it's like an actually funny big bang theory

    that's not fair to say though; you can't compare the two because big bang theory is a total shitrag
    Indeed it is, you should all start watching it right now.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 1Informative Informative x 1Friendly Friendly x 1Programming King Programming King x 1 (list)

  9. Post #2129
    Richy19's Avatar
    May 2010
    5,368 Posts
    Dont know if anyone will know the answer but in commercial enviroment what would you guys say is the most used programming language?
    I have always been wanting to progress my C++ knowledge because the games industry uses it but everyday it looks like a further and further away goal to get a job in it, so I wanted to start learning more overall used languages
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Programming King Programming King x 1 (list)

  10. Post #2130
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,693 Posts
    Its perfectly valid, but it looks like someone set their optimization level to -3

    The entire function could be inlined with just mov eax, [ecx + 4]
    Almost all code generation is like that, even with optimization on. It'd be extremely difficult to write a compiler that could take all the possible combinations of methods into account and generate "perfect code". This is why lower level code is almost always faster.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 4Dumb Dumb x 1Programming King Programming King x 1 (list)

  11. Post #2131
    Gold Member
    Darwin226's Avatar
    January 2009
    4,034 Posts
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Artistic x 7Programming King x 3Winner x 2Optimistic x 1Useful x 1Informative x 1Funny x 1 (list)

  12. Post #2132
    Tobba.'s Avatar
    February 2012
    17 Posts
    Almost all code generation is like that, even with optimization on. It'd be extremely difficult to write a compiler that could take all the possible combinations of methods into account and generate "perfect code". This is why lower level code is almost always faster.
    I do agree with this, but it doesnt even look like its trying to produce good code, and there is no excuse for not using leave, wasting 4 cycles for every function fucks with my OCD

    (User was permabanned for this post ("Tobba / Alt of permabanned user" - Swebonny))
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Programming King Programming King x 7 (list)

  13. Post #2133
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Uploaded my changes to libspotify-php here: https://github.com/Hexxeh/libspotify-php

    I'll be uploading my changes to libdespotify soon, but with a couple of bits left out, because I don't want to get lawyered up the ass.

    Hopefully this will make it easier for anyone wanting to do what I've done for themselves.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Friendly Friendly x 1Programming King Programming King x 1 (list)

  14. Post #2134
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Uploaded my changes to libspotify-php here: https://github.com/Hexxeh/libspotify-php

    I'll be uploading my changes to libdespotify soon, but with a couple of bits left out, because I don't want to get lawyered up the ass.

    Hopefully this will make it easier for anyone wanting to do what I've done for themselves.
    It's funny how you say
    Read the libspotify license, there are some important things to note; for example you CAN NOT "attempt to embed or integrate the API into any website or otherwise allow access to the Service via the web rather than via the Application.".
    and then do exactly that.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 6Zing Zing x 1Programming King Programming King x 1 (list)

  15. Post #2135
    Gold Member
    esalaka's Avatar
    July 2007
    10,065 Posts
    I don't think he's exactly "allowing access to the Service" by manipulating playlists?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Programming King Programming King x 1 (list)

  16. Post #2136
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    It's funny how you say

    and then do exactly that.
    I didn't write that disclaimer, the guy who I forked the code from did.

    But anyway, I'm not allowing anyone else access, so technically speaking I'm not breaking the ToS?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  17. Post #2137
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    I don't think he's exactly "allowing access to the Service" by manipulating playlists?
    Just recorded a quick video of my latest project, working with cosmic duck:



    http://screencast.com/t/YMS6TemR

    Oh, and the audio quality is actually great, I used Jing with Soundflower to record that video, and it totally rapes the audio quality. The streams are actually 320K MP3.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #2138

    February 2012
    42 Posts
    Furthermore, enter and leave generally take up more cycles than the push/move/pop sequence.
    Enter takes up more, leave doesnt
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  19. Post #2139
    C:\
    C:\'s Avatar
    March 2011
    1,749 Posts
    you're worse then agop, can't accept a compliment.
    Except it isn't a fucking compliment. You're rating posts that have nothing to do with programming too. Like 'I agree' = omg programming king xD
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 11Agree Agree x 4Dumb Dumb x 1Late Late x 1 (list)

  20. Post #2140
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,693 Posts
    Enter takes up more, leave doesnt
    You're right, my mistake.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  21. Post #2141
    Gold Member
    Robber's Avatar
    January 2006
    6,039 Posts
    Dont know if anyone will know the answer but in commercial enviroment what would you guys say is the most used programming language?
    I have always been wanting to progress my C++ knowledge because the games industry uses it but everyday it looks like a further and further away goal to get a job in it, so I wanted to start learning more overall used languages
    I just went through the job ads I got last year:
    3xJava
    3xC#
    2xC++
    1xVB.NET
    Reply With Quote Edit / Delete Windows 7 Austria Show Events

  22. Post #2142
    DeadKiller987's Avatar
    September 2010
    1,070 Posts
    I just went through the job ads I got last year:
    3xJava
    3xC#
    2xC++
    1xVB.NET
    1xVB.NET
    Link us. I bet it's hilarious.
    Reply With Quote Edit / Delete Windows 7 Lithuania Show Events Dumb Dumb x 8Agree Agree x 3Disagree Disagree x 1 (list)

  23. Post #2143
    Gold Member
    uitham's Avatar
    March 2010
    1,889 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
    I always have to stare at a bit of assembly code for 2 minutes before I understand what it does
    How does one actually read disassembled code properly?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 2 (list)

  24. Post #2144
    Richy19's Avatar
    May 2010
    5,368 Posts
    I just went through the job ads I got last year:
    3xJava
    3xC#
    2xC++
    1xVB.NET
    Yea it seems companies seem to be leaning towards C# more now a days(or atleast the .net framework)
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Agree Agree x 4 (list)

  25. Post #2145

    February 2010
    219 Posts
    I always have to stare at a bit of assembly code for 2 minutes before I understand what it does
    How does one actually read disassembled code properly?
    Well it's random really, One night I was looking at some disassembled ASM from GlobalMS Beta. And I just randomly went "Well crap, I know what that does" and pretty much now I just understand it. Just god forbid I try to write it

    Really id say get a few simple programs and use a debugger like IDA or olly. (I prefer IDA as it has a graph view.) Then just step through the code and watch out what it outputs. You will catch on pretty fast.
    Reply With Quote Edit / Delete Windows Vista United States Show Events Informative Informative x 2Friendly Friendly x 1 (list)

  26. Post #2146
    Hates php
    high's Avatar
    May 2006
    2,413 Posts
    Yea it seems companies seem to be leaning towards C# more now a days(or atleast the .net framework)
    C#/ASP.net


    Can't decide between doing my anonymous issue reporting in asp.net or php. I want to do asp.net so its something I can put on portfolio but I want to use php for compatibility.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  27. Post #2147

    February 2012
    42 Posts
    I always have to stare at a bit of assembly code for 2 minutes before I understand what it does
    How does one actually read disassembled code properly?
    You can only master disassembly by writing large uncommented chunks of assembly, then needing to modify it a month later
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Zing Zing x 8Agree Agree x 2Funny Funny x 1 (list)

  28. Post #2148
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Turns out somebody else beat me to this: http://blog.spotifyontheweb.com

    He got hired by Spotify. Talking to someone who works there at the moment.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Winner Winner x 7 (list)

  29. Post #2149
    jonnopon3000's Avatar
    August 2009
    380 Posts
    Here is my go at it from a while ago.
    [image]
    Lol: http://cold.netburst.co.uk/file/background.png
    So I saw these two images, and decided to go away and see if I could do something similar.
    I'm working in Java, and I'm having a couple of issues which I can't pinpoint.

    On my program's load, the user is prompted to find an image file to process and render as text. This image is loaded in, and converted to a BufferedImage so that I can get the RGB values of individual pixels.
    In the method that is supposed to produce a new BufferedImage containing the text representation of the original image, the app basically cycles over the image in 5x5 pixel blocks, obtaining an average RGB value for that block and assigning the new image's colour to that average before writing the test character "p" to the top-left of the 5x5 block in a font which I believe would be the right size.

    I can't check if it is, however, because no matter what I do or change, I get no real results from this method. The image produced is invariably a black and white grid. I've been through the code many times, using breakpoints and extensive tracing, and I am certain that everything up to the actual writing of the text is working. The average RGB colour is correct, for one thing, and yet I believe the program always draws in black or white.

    I'm at the end of my ability to troubleshoot it, so I thought I'd ask if I could be pointed in a direction where a method for doing something like this might be found.

    For anyone who may be interested in finding the issue, here's the source.
    And here's the image I am using in testing:
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  30. Post #2150
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,157 Posts
    Been away from home for GB trials, bloody shattered now :/ anyway, been working on my grapher again :) Added parametric plots with multiple parameters - you can draw proper 3D parametric surfaces now:

    Parametric torus! Plus, a bunch of random trig stuff:

    I think I'll carry on working on the debugging dialogs now.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 6Artistic Artistic x 1 (list)

  31. Post #2151
    chimitos's Avatar
    September 2010
    2,325 Posts
    Been away from home for GB trials, bloody shattered now :/ anyway, been working on my grapher again :) Added parametric plots with multiple parameters - you can draw proper 3D parametric surfaces now:
    <snipp>
    Can you script a grapher using this yet?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 3 (list)

  32. Post #2152
    Programming King and Most Patient Member 2013
    r0b0tsquid's Avatar
    December 2008
    1,157 Posts
    Can you script a grapher using this yet?
    Theoretically, yes. To be honest, pretty graphs feel more productive for the minute
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  33. Post #2153
    Gold Member
    Darwin226's Avatar
    January 2009
    4,034 Posts
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Winner Winner x 9Programming King Programming King x 1 (list)

  34. Post #2154
    LilDood's Avatar
    November 2008
    118 Posts
    I can't check if it is, however, because no matter what I do or change, I get no real results from this method. The image produced is invariably a black and white grid.
    I changed i to i*2 and j to j*2 on line 109 and got this:

    So that black and white grid is actually a bunch of p's.
    I tried changing the font and the font size but neither seemed to have any effect.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Artistic Artistic x 1Friendly Friendly x 1 (list)

  35. Post #2155
    ben1066's Avatar
    August 2009
    960 Posts
    So I was working on adding squirrel to my sourcemod and I hit a snag, for some reason the compile errors get horribly mangled and I have no idea why, circled in yellow.
    Reply With Quote Edit / Delete Windows 8 United Kingdom Show Events Informative Informative x 1Programming King Programming King x 1 (list)

  36. Post #2156
    Person
    geel9's Avatar
    June 2008
    5,562 Posts
    So I was working on adding squirrel to my sourcemod and I hit a snag, for some reason the compile errors get horribly mangled and I have no idea why, circled in yellow.
    Well there's your problem, you're programming in squirred.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 17 (list)

  37. Post #2157
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    squirrel
    eww
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 7 (list)

  38. Post #2158
    AtomiCasd's Avatar
    June 2011
    588 Posts
    Reply With Quote Edit / Delete Windows 7 Norway Show Events Funny Funny x 6Optimistic Optimistic x 1Zing Zing x 1 (list)

  39. Post #2159
    jonnopon3000's Avatar
    August 2009
    380 Posts
    I changed i to i*2 and j to j*2 on line 109 and got this:

    So that black and white grid is actually a bunch of p's.
    I tried changing the font and the font size but neither seemed to have any effect.
    Interesting, I would never have tried that :L
    Now that I've got some text to work with, I will have another stab at working out why the colour assignment is not working.

    Thanks much, sir!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 1 (list)

  40. Post #2160
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    So I was working on adding squirrel to my sourcemod and I hit a snag, for some reason the compile errors get horribly mangled and I have no idea why, circled in yellow.
    uh, alien swarm already has vscript
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 4Funny Funny x 1 (list)