• What are you working on? January 2012
    3,401 replies, posted
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. [img]http://sae.tweek.us/static/images/emoticons/emot-byodood.gif[/img]
Amidst WAYWO drama.. Content! [IMG]http://deljam.net/gifuploads/walkdemo.gif[/IMG] 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: [img]http://i.imgur.com/vcCbD.png[/img] Outdoor screenie.
[QUOTE=Yogurt;34123101]Anything followed by a -[/QUOTE] 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: [i]Sample data:[/i] [code]TestFormat: Text here![/code] [i]Pattern:[/i] [code]TestFormat: (.-)[/code] [i]Output:[/i] [code]Text here![/code] [editline]8th January 2012[/editline] I don't really know regex, but I fooled around on [url]http://regexpal.com/[/url] and it looks like I would've had to have used this to get the same output: [code][^TestFormat:](.+)[/code] [editline]8th January 2012[/editline] [QUOTE=HiredK;34124160]The flexibility of LuaBind is directly related to how good you implement it. Also isn't boost a modular library?[/QUOTE] 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. [editline]8th January 2012[/editline] [QUOTE=VoiDeD;34124184]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. [img]http://sae.tweek.us/static/images/emoticons/emot-byodood.gif[/img][/QUOTE] I was using the compiled versions. :( What a pain.
[QUOTE=amcfaggot;34124215] [i]Sample data:[/i] [code]TestFormat: Text here![/code] [i]Pattern:[/i] [code]TestFormat: (.-)[/code] [i]Output:[/i] [code]Text here![/code] [/QUOTE] Wouldn't that be the same as just "TestFormat: (.*)"?
Doesn't match for me, try it here: [url]http://regexpal.com/[/url] [img]http://img46.imageshack.us/img46/6546/regextesterregexpalgoog.png[/img] I don't know how to get the trailing space after the colon, but it's closer than what was provided: [img]http://img854.imageshack.us/img854/6546/regextesterregexpalgoog.png[/img]
With the [url=usfirst.org]FRC[/url] kit of parts came like a stack of 100 dreamspark activation code cards. Now I can use a legit install of VS.
[QUOTE=amcfaggot;34123821]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.[/QUOTE] 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 :v: [lua]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[/lua] [editline]9th January 2012[/editline] [QUOTE=supersnail11;34124322]Wouldn't that be the same as just "TestFormat: (.*)"?[/QUOTE] No. Lua's (.-) is the same as regex' (.*?)
[QUOTE=amcfaggot;34124085]Throw us a bit of your code, TheLinx or I can help you out.[/QUOTE] [url]http://pastebin.com/1FUxwkuD[/url] -PhysBase.lua An easy way to deal with shapes, bodies and fixtures [url]http://pastebin.com/imB786f1[/url] -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.
[QUOTE=raBBish;34124447]No. Lua's (.-) is the same as regex' (.*?)[/QUOTE] Sweet thanks for the heads up! [img]http://img7.imageshack.us/img7/6546/regextesterregexpalgoog.png[/img] Uh...
[QUOTE=raBBish;34124447] 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. [/QUOTE] Great pun there.
[QUOTE=ZenX2;34124481][url]http://pastebin.com/1FUxwkuD[/url] -PhysBase.lua An easy way to deal with shapes, bodies and fixtures [url]http://pastebin.com/imB786f1[/url] -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.[/QUOTE] 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.
[QUOTE=amcfaggot;34124511]Sweet thanks for the heads up! [img]http://img7.imageshack.us/img7/6546/regextesterregexpalgoog.png[/img] Uh...[/QUOTE] 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... [QUOTE=supersnail11;34124572]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...[/QUOTE] Three strings separated by a spaces and ending in a newline. The source could be "first second third\n" for example.
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...
Ah yes, very important question. That would be represented with output that looks like this: [b]STUFFSTUFFSTUFF[/b][u]<space>[/u][b]STUFFSTUFFSTUFF[/b][u]<space>[/u][b]STUFFSTUFFSTUFF[/b]\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.) [editline]8th January 2012[/editline] [QUOTE=raBBish;34124568]That's exactly how it's meant to work.[/QUOTE] I was implying such a pattern should highlight "Shit here", as it would in Lua.
[QUOTE=amcfaggot;34124597]Ah yes, very important question. That would be represented with output that looks like this: [b]STUFFSTUFFSTUFF[/b][u]<space>[/u][b]STUFFSTUFFSTUFF[/b][u]<space>[/u][b]STUFFSTUFFSTUFF[/b]\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.) [editline]8th January 2012[/editline] I was implying such a pattern should highlight "Shit here", as it would in Lua.[/QUOTE] 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-[/code] instead of finding every 3 word line?
[QUOTE=amcfaggot;34124537]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.[/QUOTE] 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.) [editline]8th January 2012[/editline] Time to split myself into multiple threads and look for clues [editline]8th January 2012[/editline] Body types are static, dynamic, and kinematic. That wasn't very hard to find [editline]8th January 2012[/editline] Huge success. I just had to make the fourth argument "dynamic"
Starting something new! SFML + libnoise [img]http://i.imgur.com/XsaC5.png[/img]
I'm already making huge progress, I just wish that 0, 0 was the origin of objects instead of their center
[QUOTE=ZenX2;34124961]I'm already making huge progress, I just wish that 0, 0 was the origin of objects instead of their center[/QUOTE] Can't you just make some sort of function that automatically grabs the origin or something?
[QUOTE=supersnail11;34124689]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-[/code] instead of finding every 3 word line?[/QUOTE] You've pretty much answered that yourself. What's shorter and returns the same data, three (.-) matches or several numeric sweeps? [editline]9th January 2012[/editline] Also, those numeric sweeps don't compensate for the "timeout" return.
not a bug: [url]https://bugs.php.net/bug.php?id=60682[/url] [editline]9th January 2012[/editline] [QUOTE=supersnail11;34124689]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-[/code] instead of finding every 3 word line?[/QUOTE] [code]/HTTP\/\d\.\d \d{3} .*/[/code]
[QUOTE=Perl;34121844]Pretty sure that's not 2d.[/QUOTE]His project? 3D. My project? 2D.
[QUOTE=mmavipc;34124406]With the [url=usfirst.org]FRC[/url] kit of parts came like a stack of 100 dreamspark activation code cards. Now I can use a legit install of VS.[/QUOTE] Dreamspark is amazing, activated an account there soon after I started college two and a half years ago.
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 :(
[QUOTE=cody8295;34105778]Got bored, started to make multithreaded friend list. [IMG]http://content.screencast.com/users/codydv/folders/Jing/media/02ce45b7-f1b8-47cf-857d-3490d34af6d5/2012-01-08_0027.png[/IMG][/QUOTE] Awww, one of your friends grandmother passed away. R.I.P. his oma.
[url=http://souleyedigitalmusic.bandcamp.com/track/predestined-fate]Predestined Fate[/url]: [url=http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Goertzel/08%20predestined%20fate.mp3.both.png][img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Goertzel/08%20predestined%20fate.mp3.both.small.png[/img][/url] (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.
[QUOTE=swift and shift;34125290]not a bug: [url]https://bugs.php.net/bug.php?id=60682[/url][/QUOTE] 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?
[QUOTE=mechanarchy;34126619]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?[/QUOTE] 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.
[QUOTE=Downsider;34128082]Dying without proper error messaging is a bug, though, but it's not really that big of a deal.[/QUOTE] 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?
[QUOTE=Lexic;34128261]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?[/QUOTE] I know nothing about php but [URL]http://codepad.org/IlPVB4C0[/URL] outputs Segmentation fault like it should.
Sorry, you need to Log In to post a reply to this thread.