tag:blogger.com,1999:blog-181006112024-03-23T14:12:02.484-04:00charlieblogInteresting things like common lisp programming, science fiction and occasional other stuff.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-18100611.post-1146683159651497952006-05-03T14:42:00.000-04:002006-05-04T12:21:54.490-04:00Setting up ASDF for CLISP+Win32It took me quite a while to figure this out so I assume that others are having troubles with it as well. It all makes sense and is quite easy once you know how but then so's almost everything!<br /><ol><br /><li>Download <A HREF=http://sourceforge.net/projects/clisp>CLISP</A> and install it.<br /><li>Download <A HREF=http://cvs.sourceforge.net/viewcvs.py/*checkout*/cclan/asdf/asdf.lisp?rev=HEAD&content-type=text/plain>ASDF</A> (Thanks <A HREF=http://www.cliki.net/>Cliki</A> for the ASDF link) and save it somewhere. I saved it in the root of the CLISP install directory. <br /><li>Choose a location for your ASDF Registry. I created an asdfs directory within the CLISP directory. Just keep these locations in mind when you next upgrade CLISP.<br /><li>For each ASDF capable library you have downloaded, create a shortcut to it's .asd file or files and put the shortcut in the ASDF registry directory.<br /><li>Make sure all the shortcuts have the same filename as the .asd they point to i.e. remove the "Shortcut to"<br /><li>Run Clisp.<br /><li>Find out where CLISP expects to find its initialization files: <pre>(user-homedir-pathname)</pre>It is probably your Documents and Settings\\Username directory but it doesn't hurt to check. <br /><li>Create a file called .clisprc.lisp in the directory discovered in the previous step. <br /><li>Put the following in the .clisprc.lisp file:<br /><pre>(load "path-to-asdf.lisp")<br />(push "path-to-asdf-registry" asdf:*central-registry*)</pre><br /><li>You should now be able to run clisp and do: <br /><pre>(asdf:oos 'asdf:load-op 'Whatever-you-want)</pre><br /></ol><br />Pretty easy, huh? Let me know where the mistakes are and if you think there are any resources that could benefit from this, let me know or just cut and paste it!charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com3tag:blogger.com,1999:blog-18100611.post-1144983142671217122006-04-13T22:32:00.000-04:002006-04-13T22:52:22.686-04:00No-IPHow can you reliably serve anything to the internet without a static IP address. You can't, right? Wrong.<br /><br />I was trying to find a way to use my dhcp powered residential internet connection to run an an ftp server or any other kind of server for that matter. I spoke to my provider and was informed that I would have to pay an extra $20 per month for a static IP. This pretty much doubles the cost of the connection. Now why would I do a thing like that? I wouldn't but luckily for me I did a little research before I gave up on the idea.<br /><br />I found that there are a number of services that allow you to forward a domain name of your choice to any IP you like. They even provide a utility that will keep your IP up to date when your ISP forcibly re-provisions you. I think that's very cool indeed and what's more, if you use <a href="http://No-IP.com">No-IP.com</a> it's free. Even if you, by some chance, have a static IP it's still a very useful, and free, service. Oh yeah and the auto-update software runs on Linux, Mac and Windows.<br /><br />I am in no way affiliated with <a href="http://No-IP.com">No-IP.com</a> I just think they are cool.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com3tag:blogger.com,1999:blog-18100611.post-1135806058847762322005-12-28T14:29:00.000-05:002005-12-28T21:09:19.776-05:00LooSeQLI've done quite a bit of work with SQL and there are two things that always occur to me when I'm using it: 1) it's really quite simple in terms of what each command does and how it does it and 2) it is really ugly; it is syntactically inelegant, inconsistent and inefficient. So what should I do? Yes, re-create it or at least a workable sub-set of it!<br /><br />Lisp should be good for making a working SQL-alike. I can use bottom up design to abstract myself from list access to SQL's set like operators and I can get some practice using macros to replicate SQL's 3i syntax. And it'll give me something to do over the holidays, of course I'm currently unemployed so every day is a holiday! ;( <br /><br />Layer 1: Basic database structure.<br />What does a database, table, column, row look like? How can I get tables from a database, columns or rows from a table, fields from a row etc. Here's what I decided on (in my own unique BNF that may or may not bear any resemblance to real BNF)<br />database -> (database (table*))<br />table -> (table (column*) (row*))<br />column -> (column column-name column-number)<br />row -> (row (datum*))<br /><br />At this stage I can create items and get at their contents but other than that they are in the same table there is no relation between rows and columns.<br /><br />Layer 2a: Adding/Removing items.<br />This layer just adds/removes tables to databases and columns and rows to tables.<br />It also maintains some basic data consistency like database, table and column name uniqueness and that rows have the correct number of elements for the tables they are added to.<br />I'm feeling pretty good about this because it allows me to do something that normal database systems generally can't: add and remove columns from tables in a live database while maintaining data consistency.<br /><br />Layer 2b: Getting and setting data.<br />Using only table column and row objects (or their unique names) I can get and set at each data item uniquely.<br /><br />Layer 3: Proto-SQL.<br />This is where things start to get interesting. I decided to make the SELECT statement and the row eliminator (WHERE clause functionality) return a temporary table. This seems like it could be pretty horrible for performance but it makes my life very easy because all the other operators can accept a temporary table just as easily as one that's connected to a database.<br />This layer also has the first macro the so called parse-where and my first ever use of eval-when for its sidekick expand-where. <br />This is also where the first major limitation occurs, consider:<br />WHERE (string= "COLUMN1" "VALUE1")<br />In normal SQL column names are double quoted and strings are single quoted. You can't do this (easily) in lisp because of #'quote/' so <span style="font-weight:bold;">no database value can have the same value as a database, table or column name</span>. I do plan to get around this using symbols at some point but not right now.<br /><br />Layer 4: Real SQL-like.<br />This part is all macros that re-arrange, de-reference and error check the 4 implemented statements: SELECT, INSERT, UPDATE and DELETE-FROM (delete's already taken).<br />There are some real limitations: no order by, no joins, no sub-selects and some departures from SQL that I think make it better: where clauses are lisp expressions and the set clause for an update statement is a list of column-names and new values.<br /><br /><pre><br />(in-package :looseql)<br />(defun test ()<br /> (setf *databases* nil)<br /> (let* ((database (make-database "DB1")))<br /> (add-table (make-table "TABLE1") database)<br /> (add-column (make-column "COLUMN0") (get-table-by-name database "TABLE1"))<br /> (add-column (make-column "COLUMN1") (get-table-by-name database "TABLE1"))<br /> (add-column (make-column "COLUMN2") (get-table-by-name database "TABLE1"))<br /> (add-database database)<br /> (setq *current-db* database)<br /><br /> (print 'inserts)<br /> (insert INTO "TABLE1" VALUES ("INS00" "INS01" "INS02"))<br /> (insert INTO "TABLE1" VALUES ("INS10" "INS11" "INS12"))<br /> (insert INTO "TABLE1" VALUES ("INS20" "INS21" "INS22"))<br /> (insert INTO "TABLE1" VALUES ("INS30" "INS31" "INS32"))<br /> (insert INTO "TABLE1" VALUES ("INS40" "INS41" "INS42"))<br /> (insert INTO "TABLE1" VALUES ("INS50" "INS51" "INS52"))<br /><br /><br /> (print 'inserts-into-columns)<br /> (insert INTO "TABLE1"("COLUMN0" "COLUMN1") VALUES ("INS0" "INS1"))<br /> (insert INTO "TABLE1"("COLUMN1" "COLUMN2") VALUES ("INS1" "INS2"))<br /> (insert INTO "TABLE1"("COLUMN0" "COLUMN2") VALUES ("INS0" "INS2"))<br /><br /> (print 'databases-after-inserts)<br /> (print *databases*)<br /><br /> (print 'select-without-where)<br /> (print (select ("COLUMN1" "COLUMN2") from "TABLE1"))<br /><br /> (print 'select-with-where)<br /> (print (select ("COLUMN1" "COLUMN2") from "TABLE1" where<br /> (or (string= "COLUMN0" "INS0")<br /> (null "COLUMN1"))))<br /> <br /> (print 'select-*)<br /> (print (select * from "TABLE1"))<br /><br /> (print 'select-into)<br /> (let (var)<br /> (select ("COLUMN0") INTO (var) FROM "TABLE1" <br /> WHERE (string= "COLUMN0" "INS50"))<br /> (print var))<br /><br /> (print 'update)<br /> (update "TABLE1" SET (("COLUMN1" "UPD1") <br /> ("COLUMN2" "UPD2"))<br /> WHERE (not (or (string= "COLUMN0" "INS0")<br /> (string= "COLUMN0" "INS00")<br /> (string= "COLUMN0" "INS10")<br /> (string= "COLUMN0" "INS20"))))<br /><br /> (print *databases*)<br /> <br /> (print 'delete-from-with-where)<br /> (delete-from "TABLE1" WHERE (null "COLUMN0"))<br /><br /> (print *databases*)<br /><br /> (print 'delete-from)<br /> (delete-from "TABLE1")<br />;;...<br />))<br /></pre><br />I think that for three days work its not too shabby.<br />I also think that the name's pretty cool LooSeQL: Lisp SQL, loose because it's not only loosely SQL and also its loosely typed and finally I hear SQL refered to as 'sequel' a lot, I think 'squil' would be more accurate, so SeQL is better because we can all agree that it sounds like 'sequel'. It would be better if I used CLOS then I could say that it was Lisp Object Oriented SeQL, maybe next version.<br /><br />Get the full source <A HREF="http://freehost03.websamba.com/charlieb/src/Looseql.tar.gz">here</A>.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com5tag:blogger.com,1999:blog-18100611.post-1135094926999184432005-12-20T10:58:00.000-05:002005-12-20T21:04:41.876-05:00New IFS-designer version.Thanks to Alexey Dejneka for supplying the latest fixes to allow cmucl to benefit from porable sdl:surface type declarations and fix some issues in the README. So following the instructions may actually result in a usable system! I also put the examples back that I forgot to include last time.<br /><br />The latest version is <a href="http//freehost03.websamba.com/charlieb/src/Ifs-0.1.2.tar.gz">0.1.2</a> and it now requires <a href="http://uffi.b9.com/">uffi</a>.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1134862741625909712005-12-17T17:25:00.000-05:002005-12-20T21:05:01.686-05:00Fixes for IFS Designer in sbcl.I can't remember exactly why I stopped using <a href="http://wwwsbcl.org/">sbcl</a>. It used to be my default lisp. I suspect that when I started using slime I just found that <a href="http://www.cons.org/cmucl/">cmucl</a> was easier. I'm happy to report, however, that sbcl works with slime (and has done for a while); I was just to busy/lazy to give it a try.<br /><br />I released the first version of the IFS Designer that does animation and the first feedback that I get is that it doesn't work under sbcl. After a bit of investigation I found that it actually does work but sbcl was emitting a warning every time I referenced an sdl:surface. An IFS typically requires 1000s of points to be drawn so getting a warning for each was a big performance problem. A little help from sbcl-help and some type declarations and all is well. Get the <a href="http//freehost03.websamba.com/charlieb/src/Ifs-0.1.1.tar.gz">0.1.1 version</a>, and thanks Zach, I'll be testing under sb and cmu cl from now on.<br />Under sbcl the IFS Designer is actually faster than under cmucl now. From not working to faster than my development environment, how amusing.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com2tag:blogger.com,1999:blog-18100611.post-1134705546691850722005-12-15T22:04:00.000-05:002005-12-16T10:08:52.686-05:00IFS Designer animates!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://freehost03.websamba.com/charlieb/images/anim-fractal.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://freehost03.websamba.com/charlieb/images/anim-fractal.gif" alt="" border="0" /></a><br />The <a href="http://freehost03.websamba.com/charlieb/src/Ifs-0.1.tar.gz">IFS Designer</a> finally does what I intended from the very beginning. It creates animated IFS fractals YAY! It's not polished but the basic functionality of creation, animation and exporting is there. I've also consolidated it so that the matrix library and the required ltk-goodie are in the 0.1.0 archive. You still have to copy the .asd files to the right place because I have no idea how to work adsf-install. I expect that'll change soon if Peter Seibel and his <a href="http://wiki.alu.org/Gardeners_Projects">gardening team</a> has anything to do with it.<br /><br />The animation functionality it pretty simple: you set the keyframes and the program will generate a smooth set of tween frames. The animation you see above is a result of 6 keyframes. I've added a short animation creation to the tutorial to the README.<br /><br />I'd love to get some feedback from anyone who installs this even if you hate it, tell me.<br /><br />And now I'm going to bed, good night.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com3tag:blogger.com,1999:blog-18100611.post-1134052344298659002005-12-08T08:51:00.000-05:002005-12-08T09:32:24.300-05:00Reddit, Linkit, lisp, java and Wesnoth.<a href="http://reddit.com/">Reddit</a> was the one general news source that could be relied upon to have lisp news on the front page. Is it too much to ask that we not alienate ourselves from a great opportunity to reach a bigger audience? I guess it is.<br />This whole thing makes us lispers look like vindictive idiots, again. I give credit to the Linkit people for doing more than yabbering impotently at one another. It's more than I could manage but Linkit's supposed to be a proof of concept but all it proves is that seven hours isn't enough time.<br />When I visited <a href="http://linkit.fractalconcept.com/asp/3IP/sdataQISXSshUzQ3wDM==/sdataQuEY-NQ=">Linkit </a> I was surprised to find that voting didn't work. This is, to my mind, one of the three fundamental features of reddit along with karma and user submissions. I know it only took seven hours but ten, twelve or even twenty-four hours to a fully working replica of reddit is a much better claim than seven hours to a broken imitation. Nice logo though.<br /><br />In other news I recently had to take a java test for employment with a certain company. Java's 'features' irritated me for a while, but then I gave up trying to make java do it my way and bent to java's will. Things went a lot better after that and my code got smaller and prettier. A lesson for all of us I think.<br /><br />Also, go and play <a href="http://www.wesnoth.org/">Battle for Wesnoth</a>, its great.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com5tag:blogger.com,1999:blog-18100611.post-1133585684283854702005-12-02T23:11:00.000-05:002005-12-02T23:54:44.426-05:00A couple of Ltk goodies.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://freehost03.websamba.com/charlieb/images/animation.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://freehost03.websamba.com/charlieb/images/animation.jpg" alt="" border="0" /></a><br />I've had cause to play with <a href="http://www.peter-herth.de/ltk/">Ltk</a> quite a lot so I thought I'd share the widgets I've made. I wrapped up the <a href="http://aspn.activestate.com/ASPN/docs/ActiveTcl/bwidget/BWidget.html">BWidget</a> tree control and a couple of other <a href="http://aspn.activestate.com/ASPN/docs/ActiveTcl/bwidget/BWidget.html">BWidgets</a> that go along with it. The BWidget tree control works reasonably well, supports drag and drop and all the usual tree stuff so there it is. Enjoy.<br /><br />The other widget is one I build from scratch. It's an animation controller widget. It supports multiple draggable frame and keyframe pointers and user controlled progress bars as well as bars that synch with frame generation. It's all CLOS so to use it all you have to do is inherit from frame and keyframe, override the frame creation methods and it'll do the rest. Nice. I created this one to use with the IFS program so that I can create custom IFS animations and it's quite handy but then I would say that.<br /><br />So <a href="http://freehost03.websamba.com/charlieb/src/Ltk-goodies.tar.gz">grab them here</a> and run the #'test function in either asdf package for a crumby demo.<br /><br />I other news I've started to learn prolog. I'm reminded of when I first started to learn lisp and the time I had to spend to understand the simplest procedure. It's also clear to me that, despite their many differences, if I didn't already know lisp it'd be a lot harder. Recursive unification makes my head hurt but at least I get the recursive part!charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1133302540635788392005-11-29T15:55:00.000-05:002005-11-29T17:39:35.993-05:00Linksys and wireless networking fun.So I just spent essentially the last two days configuring our new wireless network. I decided on Linksys hardware because it is cheap and has a reasonable reputation. The router lived up to the reputation but both of cards were a problem.<br /><br />My laptop runs Debian Linux. This is where the trouble started. I checked the compatibility list before I bought the hardware and the card was listed so I was happy. Of course it was listed, they're all listed. The only problem is that most of them have a blank space in the table where the driver name should be. Oops and arrrrgh. At this point I was worried but a little frantic googling yielded ndiswrapper.<br /><br />My normal process for setting up new software that I don't fully understand is to find as many different sets of instructions as I can and try to follow them all simultaneously. This approach usually doesn't work too well but this time it was a success. Thank-you ndiswrapper!<br /><br /> The other computer runs win98 <shudder> but at least it's not ME. To me this is like saying, "I fell from a third storey window but at least I didn't land on a spike!". I have been spoiled by Debian and, dare I say it, XP. I had forgotten what it was like to have to repeat all the steps until every mouse click and keyboard entry is perfectly executed.<br /><br />The installation seemed to be going well until the configuration utility crashed. The configuration utility would only run once; after a new installation and would always crash right after I entered the passphrase. So I couldn't get it out of infrastructure mode (static IP). Reluctantly I reverted to the classic uninstall, reinstall cycle. The first uninstall deleted the windows dhcp libraries. After a number of failed installations and some failed un-installations, I found the correct steps to make it work:<br /></shudder> <ol> <li><shudder> Uninstall the drivers and config utility, be thorough.</shudder></li> <li><shudder> Re-install the drivers causing the dhcp libraries to be re-installed (from my dusty old win98 CD).</shudder></li> <li><shudder> Reboot and quit the config utility before it has chance to crash.</shudder></li> <li><shudder> Change the advanced settings for the card in the windows network dialog to Ad Hoc mode and reboot again.</shudder></li> <li><shudder> The config utility will run again. Let it pick up the network, enter the passphrase.</shudder></li> <li><shudder> Hit OK, get a success message and quit as quickly as possible.</shudder></li> </ol> <shudder><br />It worked and I have subsequenly enabled the security settings and it all still works.<br /></shudder>charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1131490855491646012005-11-08T17:17:00.000-05:002005-11-08T20:55:50.486-05:00IFS Designer Update and TutorialI've made some more updates to my <a href="http://freehost03.websamba.com/charlieb/src/Ifs.tar.gz">IFS Designer</a>. I think it's actually quite usable now as most of the changes are GUI changes. The main window is still just a mess of buttons but I'm just waiting until I've got enough functions to warant a menu. If I made one now it'd be save, load, exit and draw and that's just not worth my trouble putting a menu together and it's not worth your trouble to make the extra click. Anyway, here's the list of changes I <span style="font-style: italic;">did</span> make:<br /><ul> <li>There is now a README that contains a short tutorial. If you don't know what an <a href="http://en.wikipedia.org/wiki/Iterated_function_system">IFS fractal</a> is this won't tell you but it will tell you how to make one and a pretty one too!</li> <li>Added a CHANGELOG, mostly to prevent me from claiming non-new features as new, also there's a (mercifully short) bug list.</li> <li>Integrated the event loops for <a href="http://www.peter-herth.de/ltk/">Ltk</a> and <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> to allow live update of IFS display. This was simply a case of telling the <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> event loop to run ltk:process-events when it's idling. I initially felt a bit wrong about this. I thought <a href="http://www.peter-herth.de/ltk/">Ltk</a> should be in charge, not some subsidiary window that's only there to show the pretties. I like <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> too but I wouldn't want to build a GUI with it! I got over myself when I realised that not only was it the path of least resistance but that the <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> event loop spent most of it's time idling anway.</li> <li>Separated the <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> display window from the IFS class hierarchy so now it displays a given IFS rather than displaying itself. This is a bit of a no-brainer, the interface is not that which it controls/displays. Sometimes it's just easier (to start with) to lump it all together and then seperate it out once you've decided which bits should go where. I guess this design method is similar to the oft cited optimisation analogy of crystalisation. You start out using lists and no type information at all. Then as you find the optimisation bottlenecks you add the necessary declarations that allow a fast program to crystalize out of the mailliable, but slower un-typed lisp. Similarly with design you start out with lots of interconnected objects then as the desired functionality becomes clearer you can start to pull them appart until you have a nice clean, modular design.</li><li>Made <a href="http://cl-sdl.sourceforge.net/">cl-sdl</a> display window exitable by changing a slot value. Now who's in control! :)<br /></li> <li>Closed windows now re-open automatically. When you close an <a href="http://www.peter-herth.de/ltk/">Ltk</a> window it is just hidden by default so it only needs to be made visible again not re-created; which is nice.</li> </ul>There's lots of extra code in the archive that's getting ready to implement exciting new features but not yet. It will give you an idea of what's on my mind though.<br /><br />There's a new version of the <a href="http://freehost03.websamba.com/charlieb/src/Matrix.tar.gz">matrix library</a> that you'll also have to get for this new version to work.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1130804629280863542005-10-31T18:05:00.000-05:002005-10-31T19:23:49.336-05:00IFS Designer UpdateI just uploaded a new version of my <a href="http://freehost03.websamba.com/charlieb/src/Ifs.tar.gz">IFS designer</a>. The changes are:<br /><ul> <li>Added save and load functions</li> <li>Added some simple examples (<a href="http://en.wikipedia.org/wiki/Sierpinski_triangle">sierpinski triangle</a>, fern, square and square spiral)</li> <li>You can now use the left mouse button to move (translate) the view for both the transform display window and the fractal window.</li> <li>You can now use the right mouse button to zoom (scale) the view for both the transform display window and the fractal window.</li> <li>Fixed an evil little bug with the transform selector that was causing IFS performance to be very poor. It should select the transforms at random weighted by the size of the determinant but instead it picked the last transform much more often. This caused the point density of the fractals to be all wrong but the fractals were still mostly the right shape. I love resillient algorithms, especially ones that can survive me!</li> </ul> The next issue I have to tackle is that the <a href="http://www.cliki.net/CL-SDL">cl-sdl</a> based fractal viewer (the rest is <a href="http://www.peter-herth.de/ltk/">ltk</a>) has it's own event loop so you have to quit it (hit q) before you can go back to editing the transforms. I guess I'll have to mesh the ltk and cl-sdl event loops together.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1130512468184496932005-10-28T09:30:00.000-04:002005-10-28T12:11:02.390-04:00IFS Designer first Release<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://freehost03.websamba.com/charlieb/images/ifs.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://freehost03.websamba.com/charlieb/images/ifs.jpg" alt="" border="0" /></a><br />I have just made the first release of my <a href="http://freehost03.websamba.com/charlieb/src/Ifs.tar.gz">IFS Designer</a> program.<br />The new features are:<br /><ul> <li>Generates IFS Fractals in an <a href="http://www.cliki.net/CL-SDL">SDL</a> window. I realize that this is the whole point but since it's the first release even core functionality is a new feature!</li> <li>SDL window allows you to zoom into the fractal you've created. This is useful because many of the nice familiar fractals are contained in a unit square so without zooming they'd just be a dot and where's the fun in that?<br /></li> <li>The interface allows you to easily select and manipulate transformations that make up the fractal. Thanks <a href="http://www.peter-herth.de/ltk/">Ltk</a>!</li> <li>Choose the number of points you draw for the fractal so you can get almost instant results or dense images.</li><li>LLGPL License for both the <a href="http://freehost03.websamba.com/charlieb/src/Ifs.tar.gz">IFS Designer</a> and the <a href="http://freehost03.websamba.com/charlieb/src/Matrix.tar.gz">matrix library</a><br /></li> </ul><br />Of course feedback is always welcome.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0tag:blogger.com,1999:blog-18100611.post-1130196273853181202005-10-24T18:39:00.000-04:002005-10-24T19:30:26.513-04:00IFS Designer Project starts to take shape.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/1255/1763/1600/ifs-transform-screenshot.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/1255/1763/200/ifs-transform-screenshot.jpg" alt="" border="0" /></a><br />I've been putting in some work on my new and interesting project. It's a fun little app <span style="font-size:100%;">developed in <a href="http://www.cliki.net/index">common lisp</a> with <a href="http://www.peter-herth.de/ltk/">Ltk</a> (a lisp interface into <a href="http://activestate.com/Tcl.plex?hdr=1">tcl/tk</a>) in <a href="http://common-lisp.net/project/slime/">slime.</a></span> It allow you to design 2D <a href="http://en.wikipedia.org/wiki/Iterated_function_system">IFS fractals</a> by graphically manipulating the transforms that comprise them.<br />I really like the IFS algorithm because it's just sooo simple:<br /><ol> <li>Take a number of transformations (scale, rotate, translate). Three is enough to produce a nice standard fern-like fractal.</li> <li>Starting at the origin, apply the transforms in a random order <span style="font-size:85%;">(weighted by the size (<a href="http://en.wikipedia.org/wiki/Determinant">determinant</a>) of the transformation <a href="http://en.wikipedia.org/wiki/Transformation_matrix">matrix</a>)</span></li> <li><span style="font-size:100%;">After about 100-200 iterations, start to draw the points.</span></li> <li><span style="font-size:100%;">Finish when you feel the image is dense enough.</span></li> </ol><span style="font-size:100%;">Simple eh?<br />I'm no mathematician but the why goes like this:<br /></span> <ul> <li><span style="font-size:100%;">The transforms represent a fractal attractor - the transforms are a very concise description of a set of points in space.</span></li> <li><span style="font-size:100%;">Each transform maps a part of the attractor onto itself - when you start on the attractor and apply one of the transforms the result will still be on the attractor.</span></li> <li><span style="font-size:100%;">Applying a transform to a random point will make it closer to the attractor - I suppose this is why it's called an 'attractor' :) . This is why you discard the first few points, to make sure you're at least near the attractor when you start to draw the points.</span></li> <li><span style="font-size:85%;">Weighting the picking of the transforms by determinant isn't actually necessary but it does improve the performance of the algorithm.</span><br /></li> </ul><span style="font-size:100%;">I'm not ready to show off any IFS fractals (yet) but I can give you the <a href="http://www.websamba.com/charlieb/src/Matrix.tar.gz">matrix library</a> I developed for this project.<br /></span>charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com2tag:blogger.com,1999:blog-18100611.post-1129847670921354442005-10-20T18:18:00.000-04:002005-10-20T18:36:33.823-04:00My new blog, Yay!The purpose of this blog is not just to big-up myself. I will be doing that plenty don't worry but the real purpose of starting this is to force myself to actually let other people see some of the software I write.<br /><br />I'm a big fan of open source software and I'd like to achive the dual ends of entertaining myself and giving something to the movement that has given me so much great software. In order to do that I'm going to have to open myself to criticism. I'm sure that I'm not the only one who has developed a nice little library of interesing stuff but is too scared that people will think that it's rubbish to actually do anything but play with it myself. So I have resolved to stop simply masturbating and start, no no that's as far as I'm prepared to push that particular metaphor.<br /><br />I guess I'll also be putting some other stuff up here as the mood takes me, it will probably mostly be to do with sci-fi books but I expect the occasional post about UK/US culture shock will creep in as I get out there more and find a job and stuff.charliebhttp://www.blogger.com/profile/06848499460087138279noreply@blogger.com0