1. Post #921
    Gold Member
    Yogurt's Avatar
    December 2006
    1,089 Posts
    To all you regex experts - what would (.-) match?
    Anything followed by a -
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 5Useful Useful x 1Agree Agree x 1Informative Informative x 1 (list)

  2. Post #922
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Who the hell dissed LuaBind? This is nothing short of fucking amazing.

    My problem is that it's good for small projects, but not much more. But then in that context you're working with Boost. So, if you're working with Boost on a small project, chances are - Boost is going to be multiple times larger than your project. So why use Boost? Because you want to use LuaBind.

    If your logic is that you want to use LuaBind for LuaBind, and you don't care what the expense is to do that, then okay that's fine. Otherwise, you sacrifice some flexibility using it that would be important to have on larger projects, such as extending types in Lua and using them across multiple modules.

    Edited:

    I used it way, way back. About 2 years ago. The entire HL2:SB codebase was going to rely on it. I remember somewhere saying Garry would have used it or something had he the chance to redo things. I'm not sure if he has since changed his position on that, but I definitely did. After seeing what the C API is capable of on its own, I'm not sure I'd want to use anything else.

    That and it uses Boost, which I'm not the biggest fan of due to the work you have to go through to use it, but otherwise I won't complain about it since I haven't really utilized it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  3. Post #923
    Gold Member
    ZenX2's Avatar
    February 2009
    4,957 Posts
    Okay. I know that the physics world is being updated, and my entities have the necessary bodies, shapes, and fixtures, yet they still refuse to do anything.

    I think this might have something to do with how when I try using Body:setMassData, it doesn't change anything.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #924
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Okay. I know that the physics world is being updated, and my entities have the necessary bodies, shapes, and fixtures, yet they still refuse to do anything.

    I think this might have something to do with how when I try using Body:setMassData, it doesn't change anything.
    Throw us a bit of your code, TheLinx or I can help you out.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  5. Post #925
    DevBug's Avatar
    July 2010
    1,059 Posts
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Funny Funny x 22Dumb Dumb x 1 (list)

  6. Post #926
    Gold Member
    HiredK's Avatar
    November 2006
    419 Posts
    My problem is that it's good for small projects, but not much more. But then in that context you're working with Boost. So, if you're working with Boost on a small project, chances are - Boost is going to be multiple times larger than your project. So why use Boost? Because you want to use LuaBind.

    If your logic is that you want to use LuaBind for LuaBind, and you don't care what the expense is to do that, then okay that's fine. Otherwise, you sacrifice some flexibility using it that would be important to have on larger projects, such as extending types in Lua and using them across multiple modules.

    Edited:

    I used it way, way back. About 2 years ago. The entire HL2:SB codebase was going to rely on it. I remember somewhere saying Garry would have used it or something had he the chance to redo things. I'm not sure if he has since changed his position on that, but I definitely did. After seeing what the C API is capable of on its own, I'm not sure I'd want to use anything else.

    That and it uses Boost, which I'm not the biggest fan of due to the work you have to go through to use it, but otherwise I won't complain about it since I haven't really utilized it.
    The flexibility of LuaBind is directly related to how good you implement it. Also isn't boost a modular library?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  7. Post #927
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    I like to consider Boost the most useful headache on the planet.

    If I'm using the headers only, it's pretty smooth sailing. Can't say the same for compiled versions of it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Disagree Disagree x 1 (list)

  8. Post #928
    Gold Member
    Downsider's Avatar
    July 2007
    1,996 Posts
    Amidst WAYWO drama.. Content!



    I re-did the downward's walking animation and made a gun firing animation. They both use my super-awesome animation system, obviously. The upwards one is in progress but I thought it looked funny enough and therefore deserved to be left in for hilarity's sake. This was recorded on my PC and the dude on the bottom is also me, playing on my iPhone.

    Also I updated my automagic GIF screen recorder/uploader to work with ImageMagick to do a more optimized conversion from frame data -> GIF.

    EDIT:



    Outdoor screenie.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Artistic Artistic x 18Optimistic Optimistic x 1 (list)

  9. Post #929
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Anything followed by a -
    That's really gonna confuse me in the future when I actually get around to learning regex. In Lua, there are things called Lua patterns, and not regex, and using (.-) would result in something like this:

    Sample data:
    Code:
    TestFormat: Text here!
    Pattern:
    Code:
    TestFormat: (.-)
    Output:
    Code:
    Text here!
    Edited:

    I don't really know regex, but I fooled around on http://regexpal.com/ and it looks like I would've had to have used this to get the same output:

    Code:
    [^TestFormat:](.+)
    Edited:

    The flexibility of LuaBind is directly related to how good you implement it. Also isn't boost a modular library?
    To me that's a bit of a generic statement, because LuaBind has one way of doing things. You can't use it, and the Lua C API in tandem. You just outright lose functionality by using it.

    Edited:

    I like to consider Boost the most useful headache on the planet.

    If I'm using the headers only, it's pretty smooth sailing. Can't say the same for compiled versions of it.
    I was using the compiled versions. :( What a pain.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 1 (list)

  10. Post #930
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Sample data:
    Code:
    TestFormat: Text here!
    Pattern:
    Code:
    TestFormat: (.-)
    Output:
    Code:
    Text here!
    Wouldn't that be the same as just "TestFormat: (.*)"?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  11. Post #931
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Doesn't match for me, try it here: http://regexpal.com/



    I don't know how to get the trailing space after the colon, but it's closer than what was provided:

    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #932
    mmavipc's Avatar
    February 2009
    843 Posts
    With the FRC kit of parts came like a stack of 100 dreamspark activation code cards. Now I can use a legit install of VS.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 3Funny Funny x 1 (list)

  13. Post #933
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    That and it uses Boost, which I'm not the biggest fan of due to the work you have to go through to use it, but otherwise I won't complain about it since I haven't really utilized it.
    Boost isn't really hard to use. Sure, it's big (100 MB of code), but only 12 libraries out of 84 need compiling, and those aren't used very often (well, maybe filesystem). Just uncompress it somewhere, set the BOOST_ROOT and you're ready to roll. My main reason for not using it was the size, but I can see now that's not really a concern; my DLL weighs about 800 KB in release, with Lua, LuaJIT and LuaBind statically linked.
    With my only reason for not using it gone, I gave it a try and I'm not disappointed. It's a really helpful addition to C++.
    As for LuaBind; it took about a day to convert my old progress to it, but it's a massive boost to my coding rate, not having to write wrappers for everything.

    I can do this by writing three functions

    local ccc = cvar.CCommandCallback( function( cmd )
    	print "cmd called"
    end )
    
    local cccc = cvar.CCommandCompletionCallback( function( partial )
    	print( "P", partial )
    end )
    
    testc = cvar.ConCommand( "ir_test", ccc, "HALP", 0, cccc )
    
    local lua_run_c = cvar.CCommandCallback( function( cmd )
    	local f = loadstring( cmd.ArgS )
    	if f then
    		f()
    	else
    		print.error["lua"]( "Error or something" )
    	end
    end )
    
    local lua_run = cvar.ConCommand( "ir_lua_run", lua_run_c )
    
    sv_cheats = icvar:FindVar("sv_cheats")
    
    local oldflags = sv_cheats.Flags
    local oldval = sv_cheats.string
    
    sv_cheats.Name = "not_sv_cheats"
    sv_cheats.Flags = 0
    sv_cheats.int = 1
    
    new_cheats = cvar.ConVar( "sv_cheats", "0", oldflags, sv_cheats.Help)
    new_cheats.Name = "sv_cheats"
    new_cheats.string = oldval

    Edited:

    Wouldn't that be the same as just "TestFormat: (.*)"?
    No. Lua's (.-) is the same as regex' (.*?)
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 1Friendly Friendly x 1 (list)

  14. Post #934
    Gold Member
    ZenX2's Avatar
    February 2009
    4,957 Posts
    Throw us a bit of your code, TheLinx or I can help you out.
    http://pastebin.com/1FUxwkuD
    -PhysBase.lua
    An easy way to deal with shapes, bodies and fixtures

    http://pastebin.com/imB786f1
    -Entity.lua
    The base class for entities. Ent is a manager of sorts.

    I've checked and World:update(dt) is getting called as it should be, and that's about it.
    I've also checked in my console about Body:setMassData. No matter what I set it to, Body:getMassData always returns four 0s.

    Also; ignore PhysRect, I haven't worked on updating that. And feel free to judge my coding style and use of 1 letter variables.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #935
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    No. Lua's (.-) is the same as regex' (.*?)
    Sweet thanks for the heads up!



    Uh...
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 2 (list)

  16. Post #936
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    As for LuaBind; it took about a day to convert my old progress to it, but it's a massive boost to my coding rate, not having to write wrappers for everything.
    Great pun there.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 4 (list)

  17. Post #937
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    http://pastebin.com/1FUxwkuD
    -PhysBase.lua
    An easy way to deal with shapes, bodies and fixtures

    http://pastebin.com/imB786f1
    -Entity.lua
    The base class for entities. Ent is a manager of sorts.

    I've checked and World:update(dt) is getting called as it should be, and that's about it.
    I've also checked in my console about Body:setMassData. No matter what I set it to, Body:getMassData always returns four 0s.

    Also; ignore PhysRect, I haven't worked on updating that. And feel free to judge my coding style and use of 1 letter variables.
    Maybe I'm blind or something (I haven't worked with LOVE in a while, but this type of issue should look obvious) but it doesn't look like you're setting mass anywhere.

    It's the third argument for newBody.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #938
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Sweet thanks for the heads up!



    Uh...
    That's exactly how it's meant to work. ? after * or + makes the match lazy, so it only matches as little as it needs. In this case nothing. But having something else in the group can force it to match, like (\s.*?\s) would match " Shit ". Without the ? modifier, it would be " Shit here " (assuming whitespace at the end)
    I can't remember if Lua's .- works like that though...

    Also, a question about the FP Lua SDK: connectors/luacurl.lua line 43:
    string.match( r, "(.-) (.-) (.-)\n" )
    What is this supposed to find? Apparently it's supposed to contain the status code, and the session token...
    Three strings separated by a spaces and ending in a newline. The source could be "first second third\n" for example.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  19. Post #939
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Also, a question about the FP Lua SDK: connectors/luacurl.lua line 43:
    string.match( r, "(.-) (.-) (.-)\n" )
    What is this supposed to find? Apparently it's supposed to contain the status code, and the session token...
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  20. Post #940
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Ah yes, very important question. That would be represented with output that looks like this:

    STUFFSTUFFSTUFF<space>STUFFSTUFFSTUFF<space>STUFFSTUFFSTUFF\n

    Where stuff in bold is (.-) and is the output you receive and nothing more, and underlined spaces are the spaces represented in the pattern, which are discarded. (The newline is also ignored as it is not in parentheses.)

    Edited:

    That's exactly how it's meant to work.
    I was implying such a pattern should highlight "Shit here", as it would in Lua.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #941
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Ah yes, very important question. That would be represented with output that looks like this:

    STUFFSTUFFSTUFF<space>STUFFSTUFFSTUFF<space>STUFFSTUFFSTUFF\n

    Where stuff in bold is (.-) and is the output you receive and nothing more, and underlined spaces are the spaces represented in the pattern, which are discarded. (The newline is also ignored as it is not in parentheses.)

    Edited:



    I was implying such a pattern should highlight "Shit here", as it would in Lua.
    Wouldn't it be easier to do something like:
    Code:
    HTTP/1.[0-1] ([0-9]|[1-9][0-9]|[1-9][0-9][0-9]) -something for the status string-
    instead of finding every 3 word line?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #942
    Gold Member
    ZenX2's Avatar
    February 2009
    4,957 Posts
    Maybe I'm blind or something (I haven't worked with LOVE in a while, but this type of issue should look obvious) but it doesn't look like you're setting mass anywhere.

    It's the third argument for newBody.
    The first argument is the world, the second and third are x and y, and the fourth is the bodytype, which defaults to static. I'm guessing I might need to put "dynamic" or something there. (It takes a string.)

    Edited:

    Time to split myself into multiple threads and look for clues

    Edited:

    Body types are static, dynamic, and kinematic. That wasn't very hard to find

    Edited:

    Huge success. I just had to make the fourth argument "dynamic"
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #943
    Parad0x0217's Avatar
    May 2011
    73 Posts
    Starting something new!
    SFML + libnoise

    Reply With Quote Edit / Delete Windows 7 United States Show Events Artistic Artistic x 7 (list)

  24. Post #944
    Gold Member
    ZenX2's Avatar
    February 2009
    4,957 Posts
    I'm already making huge progress, I just wish that 0, 0 was the origin of objects instead of their center
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  25. Post #945
    Gold Member
    uitham's Avatar
    March 2010
    1,893 Posts
    I'm already making huge progress, I just wish that 0, 0 was the origin of objects instead of their center
    Can't you just make some sort of function that automatically grabs the origin or something?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 2 (list)

  26. Post #946
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Wouldn't it be easier to do something like:
    Code:
    HTTP/1.[0-1] ([0-9]|[1-9][0-9]|[1-9][0-9][0-9]) -something for the status string-
    instead of finding every 3 word line?
    You've pretty much answered that yourself. What's shorter and returns the same data, three (.-) matches or several numeric sweeps?

    Edited:

    Also, those numeric sweeps don't compensate for the "timeout" return.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  27. Post #947
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    not a bug: https://bugs.php.net/bug.php?id=60682

    Edited:

    Wouldn't it be easier to do something like:
    Code:
    HTTP/1.[0-1] ([0-9]|[1-9][0-9]|[1-9][0-9][0-9]) -something for the status string-
    instead of finding every 3 word line?
    Code:
    /HTTP\/\d\.\d \d{3} .*/
    Reply With Quote Edit / Delete Mac Australia Show Events Funny Funny x 1 (list)

  28. Post #948
    Shotgunz's Avatar
    September 2008
    703 Posts
    Pretty sure that's not 2d.
    His project?
    3D.

    My project?
    2D.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  29. Post #949
    sLysdal's Avatar
    December 2008
    271 Posts
    With the FRC kit of parts came like a stack of 100 dreamspark activation code cards. Now I can use a legit install of VS.
    Dreamspark is amazing, activated an account there soon after I started college two and a half years ago.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 4 (list)

  30. Post #950
    Gold Member
    dije's Avatar
    December 2008
    4,745 Posts
    I'm making a pixel coord system thingy, but I probably need some sort of api for it since Java's built in graphics functions ain't good :(
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  31. Post #951
    MitchvW's Avatar
    September 2011
    1,488 Posts
    Got bored, started to make multithreaded friend list.

    Awww, one of your friends grandmother passed away.
    R.I.P. his oma.
    Reply With Quote Edit / Delete Windows Vista Netherlands Show Events Funny Funny x 12 (list)

  32. Post #952
    Tamschi's Avatar
    December 2009
    3,166 Posts
    Predestined Fate:


    (Click for 27434x88)

    Brightness˛ is relative magnitude, orange is left channel only, blue is right only.

    I'm running the simplified Goertzel algorithm on the piano key frequencies, the block size is adjusted for each pitch.

    I'm using NAudio for decoding MP3. The image width is clamped to a maximum of 65000, otherwise .NET's PNG encoder would crash when saving.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Artistic Artistic x 4Winner Winner x 2 (list)

  33. Post #953
    Gold Member
    mechanarchy's Avatar
    September 2009
    1,214 Posts
    wow php is worse than i remember. it's like they're actively trying to make the language worse! Not to mention that representative guy can't spell to the point where his own name looks like a typo -- "laruence" vs "laurence", anyone?
    Reply With Quote Edit / Delete Linux Australia Show Events Funny Funny x 8Agree Agree x 3 (list)

  34. Post #954
    Gold Member
    Downsider's Avatar
    July 2007
    1,996 Posts
    wow php is worse than i remember. it's like they're actively trying to make the language worse! Not to mention that representative guy can't spell to the point where his own name looks like a typo -- "laruence" vs "laurence", anyone?
    Running out of memory on the stack is hardly a bug, it's something that exists in pretty much every language when you try to allocate memory on the stack and there's not enough to go around. Dying without proper error messaging is a bug, though, but it's not really that big of a deal. You should be wary of the memory you're utilizing in any language to avoid issues like this in the first place.
    Reply With Quote Edit / Delete Windows XP United States Show Events Disagree Disagree x 1 (list)

  35. Post #955
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Dying without proper error messaging is a bug, though, but it's not really that big of a deal.
    The script should crash, not the VM. If you run that test script, it takes out the entire PHP runtime. That's a massive bug, no?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  36. Post #956
    Gold Member
    Darwin226's Avatar
    January 2009
    4,056 Posts
    The script should crash, not the VM. If you run that test script, it takes out the entire PHP runtime. That's a massive bug, no?
    I know nothing about php but
    http://codepad.org/IlPVB4C0
    outputs Segmentation fault like it should.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Dumb Dumb x 3 (list)

  37. Post #957
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    I know nothing about php but
    http://codepad.org/IlPVB4C0
    outputs Segmentation fault like it should.
    except the expected behavior isn't a segmentation fault
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2 (list)

  38. Post #958
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Dreamspark is amazing, activated an account there soon after I started college two and a half years ago.
    Don't forget to check if they're part of MSDNAA, it's even better. Having access to every version of Visual Studio starting from 2003 and Windows XP, Vista, 7 and Servers is awesome.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 5 (list)

  39. Post #959
    Gold Member
    Darwin226's Avatar
    January 2009
    4,056 Posts
    except the expected behavior isn't a segmentation fault
    Oh sorry. I read the bug report wrong.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Friendly Friendly x 1 (list)

  40. Post #960
    Icedshot's Avatar
    April 2010
    2,323 Posts
    I just tried out that equation, and I feel like it's a little too strong.

    Here's the one I use:

    f = r / (sqrt(1.0 - r*r) + K);

    You may recognize the circle equation in there. K is a constant which 'flattens' the planet so that the edges aren't as distorted. .75 is a good value for K.
    Goddammit, you're right



    Edit:

    Well, i just came up with this:


    Not sure which one looks better, ignore the terrain generation

    Edit 2:
    I just noticed that my terrain generation suffers from stair stepping. Ill go fix that
    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events Artistic Artistic x 8 (list)