Comments for Casual Game Development http://blog.pettomato.com Techniques and Algorithms Sun, 09 Sep 2007 22:06:42 +0000 http://wordpress.org/?v=2.1.2 Comment on Emacs mode for AS3 by austin http://blog.pettomato.com/?p=22#comment-15863 austin Fri, 10 Aug 2007 16:12:13 +0000 http://blog.pettomato.com/?p=22#comment-15863 Bela, If you want long lines to visually wrap to the next line, add this to your .emacs: (setq-default truncate-lines nil) If you want different behavior for different modes, you'll have to figure out how to set that value per mode. If you just want the slashes to disappear, but the behavior to remain the same, then I don't know how to do that. Bela,

If you want long lines to visually wrap to the next line, add this to your .emacs:
(setq-default truncate-lines nil)

If you want different behavior for different modes, you’ll have to figure out how to set that value per mode.

If you just want the slashes to disappear, but the behavior to remain the same, then I don’t know how to do that.

]]>
Comment on Emacs mode for AS3 by Bela http://blog.pettomato.com/?p=22#comment-15862 Bela Fri, 10 Aug 2007 16:00:04 +0000 http://blog.pettomato.com/?p=22#comment-15862 Is there a way to customize emacs not to show "\" when line is too long? when the line is too long, emacs will append "\" to indicate there is an additional line. Is there a way to customize emacs not to show "\" when line is too long? Thanks. Is there a way to customize emacs not to show “\” when line is too long?

when the line is too long, emacs will append “\” to indicate there is an additional line. Is there a way to customize emacs not to show “\” when line is too long?

Thanks.

]]>
Comment on Memoization in Actionscript by Arthur Debert http://blog.pettomato.com/?p=23#comment-14624 Arthur Debert Thu, 19 Jul 2007 20:10:56 +0000 http://blog.pettomato.com/?p=23#comment-14624 Thanks for the code. I've been implementing an AS memoize today and your post is really helpful. As an extra performance adjustments, I've kept a static dictionary, using each initial function as keys so that different instances of the Memo class that wrap the same function can share the same values cache. I has this done in AS2, and it was much easier! In as2, functions are real objects and you could create properties on them directly, no need for an external class. I've tried to do this in AS3 and I get an error telling me that I cannot create a property on a MethodClosure object, which, unfortunately is supposed to be dynamic but really isn't. Cheers Arthur Thanks for the code. I’ve been implementing an AS memoize today and your post is really helpful. As an extra performance adjustments, I’ve kept a static dictionary, using each initial function as keys so that different instances of the Memo class that wrap the same function can share the same values cache.

I has this done in AS2, and it was much easier! In as2, functions are real objects and you could create properties on them directly, no need for an external class. I’ve tried to do this in AS3 and I get an error telling me that I cannot create a property on a MethodClosure object, which, unfortunately is supposed to be dynamic but really isn’t.

Cheers
Arthur

]]>
Comment on Flash Socket Server in Lisp by LispNewb http://blog.pettomato.com/?p=17#comment-13011 LispNewb Mon, 18 Jun 2007 22:15:59 +0000 http://blog.pettomato.com/?p=17#comment-13011 Thanks, that clears things up. Thanks, that clears things up.

]]>
Comment on Flash Socket Server in Lisp by austin http://blog.pettomato.com/?p=17#comment-12922 austin Sun, 17 Jun 2007 21:49:35 +0000 http://blog.pettomato.com/?p=17#comment-12922 LispNewb, The short answer is: because defmethod was used for the same functions in the code I built this off of, which is linked at the top of the post. Since I removed the arguments from run, it could probably be a defun. I believe handle-client is defined using defmethod to specialize the method on the inet-socket argument type. LispNewb,
The short answer is: because defmethod was used for the same functions in the code I built this off of, which is linked at the top of the post. Since I removed the arguments from run, it could probably be a defun. I believe handle-client is defined using defmethod to specialize the method on the inet-socket argument type.

]]>
Comment on Flash Socket Server in Lisp by LispNewb http://blog.pettomato.com/?p=17#comment-12917 LispNewb Sun, 17 Jun 2007 20:09:16 +0000 http://blog.pettomato.com/?p=17#comment-12917 Why do you use defmethod instead of defun for run and handle-client? Why do you use defmethod instead of defun for run and handle-client?

]]>
Comment on actionscript-mode for EmacsW32 by Vagn http://blog.pettomato.com/?p=24#comment-12551 Vagn Tue, 12 Jun 2007 17:47:10 +0000 http://blog.pettomato.com/?p=24#comment-12551 May I you suggest some colors for people running with light backgrounds: Add the following (if (equal (frame-parameter nil 'background-mode) 'light) (setq red "darkred" green "green4" yellow "darkmagenta" blue "blue" magenta "turquoise4" cyan "navy")) After the line " (white "#f0f0f0"))" (Line 328) The proper way to support this is probably by using the "background" attribute in the defface calls. May I you suggest some colors for people running with light backgrounds:

Add the following

(if (equal (frame-parameter nil ‘background-mode) ‘light)
(setq red “darkred” green “green4″ yellow “darkmagenta” blue “blue”
magenta “turquoise4″ cyan “navy”))

After the line ” (white “#f0f0f0″))” (Line 328)

The proper way to support this is probably by using the “background” attribute in the defface calls.

]]>
Comment on Emacs mode for AS3 by austin http://blog.pettomato.com/?p=22#comment-10953 austin Thu, 17 May 2007 13:11:07 +0000 http://blog.pettomato.com/?p=22#comment-10953 Hi matt, There are so many special characters in that regexp that must be confusing the system. I'm not sure if I can fix it, but I know the semantic parsing in actionscript-mode could be improved. I just don't know if it'll ever be able to handle unquoted arbitrary regular expressions. You might try using the RegExp constructor instead of a regexp literal, like this one, from the livedocs: var re1:RegExp = new RegExp("bob", "i"); You'd probably have to escape those quotes in your regexp, though. Hi matt,
There are so many special characters in that regexp that must be confusing the system. I’m not sure if I can fix it, but I know the semantic parsing in actionscript-mode could be improved. I just don’t know if it’ll ever be able to handle unquoted arbitrary regular expressions. You might try using the RegExp constructor instead of a regexp literal, like this one, from the livedocs: var re1:RegExp = new RegExp(”bob”, “i”); You’d probably have to escape those quotes in your regexp, though.

]]>
Comment on Emacs mode for AS3 by matt http://blog.pettomato.com/?p=22#comment-10927 matt Thu, 17 May 2007 02:07:28 +0000 http://blog.pettomato.com/?p=22#comment-10927 thanks a lot! starting to use this heavily, but found miss-hilighting after this code.. var regexp:RegExp = /<a>]*?href=['"](.*?(.jpg|.jpeg|.gif|.bmp|.png))['"][^]*?>[^]*?]*?src=['"](.*?(.jpg|.jpeg|.gif|.bmp|.png))['"][^]*?>/ig; can it be fixed? might should fix my regexp first.. thanks a lot! starting to use this heavily,
but found miss-hilighting after this code..

var regexp:RegExp = /]*?href=[’”](.*?(.jpg|.jpeg|.gif|.bmp|.png))[’”][^]*?>[^]*?]*?src=[’”](.*?(.jpg|.jpeg|.gif|.bmp|.png))[’”][^]*?>/ig;

can it be fixed?
might should fix my regexp first..

]]>
Comment on Emacs mode for AS3 by Joe http://blog.pettomato.com/?p=22#comment-10404 Joe Wed, 09 May 2007 20:04:58 +0000 http://blog.pettomato.com/?p=22#comment-10404 woops, you nead version 5.29 cvs -z3 -d:pserver:anonymous@cc-mode.cvs.sourceforge.net:/cvsroot/cc-mode co -rRelease_5_29 cc-mode woops, you nead version 5.29
cvs -z3 -d:pserver:anonymous@cc-mode.cvs.sourceforge.net:/cvsroot/cc-mode co -rRelease_5_29 cc-mode

]]>