To get emacs to syntax color clojurescript files (cljs) add this to your .emacs (or other emacs config file):
(setq auto-mode-alist (cons '("\\.cljs" . clojure-mode) auto-mode-alist))it's all about the pattern
To get emacs to syntax color clojurescript files (cljs) add this to your .emacs (or other emacs config file):
(setq auto-mode-alist (cons '("\\.cljs" . clojure-mode) auto-mode-alist))Well, I too have gone down the rabbit hole of having to upgrade compiled-from-source apps to 64bit architecture after moving to Snow Leopard. The hardest by far was postgres. The sad thing is that 32bit version works just fine, but the adapter gems for rails don’t, hence the need for the recompile.
Mostly I followed this blog post, but it assumes that you had previously installed postgres using his instructions for Leopard which I hadn’t.
My previous installation was at /usr/local/postgres and these instructions end up installing it at /usr/local/pgsql, so my task also includes getting the data from my previous installation to the new on.
I also took some some hints from this post.
Here’s the blow by blow:
Make a backup of all my data from the 32bit version:
pg_dumpall > /tmp/32-bit-dump.sql
Switch to super user, make a directory for the source (if you haven’t already), download and extract it:
sudo su mkdir /usr/local/src cd /usr/local/src curl -O http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v8.3.8/postgresql-8.3.8.tar.gz tar -zvxf postgresql-8.3.8.tar.gz rm postgresql-8.3.8.tar.gz
Now configure, make and install it:
cd postgresql-8.3.8 ./configure --enable-thread-safety --with-bonjour make make install
Then I followed the instructions from the above mentioned blog on how to make a postgres user, but I did them in a different terminal window because remember the other one we were logged in as root:
“First, you’ll need to find an unused user and group ID. Use the following commands to list the IDs for the users and groups on your system.”
dscl . -list /Groups PrimaryGroupID | awk '{print $2}' | sort -n
dscl . -list /Users UniqueID | awk '{print $2}' | sort -n“For the purposes of this tutorial, let’s assume an ID of 113 for both the user and the group. Since the convention is to prefix system accounts with an underscore, use the following commands to create a user called _postgres:”
sudo dscl . create /Users/_postgres UniqueID 113 sudo dscl . create /Users/_postgres PrimaryGroupID 113 sudo dscl . create /Users/_postgres NFSHomeDirectory /usr/local/pgsql/ sudo dscl . create /Users/_postgres RealName "PostgreSQL Server" sudo dscl . create /Users/_postgres Password "*" sudo dscl . append /Users/_postgres RecordName postgres
“Then, create the _postgres group:”
sudo dscl . create /Groups/_postgres sudo dscl . create /Groups/_postgres PrimaryGroupID 113 sudo dscl . append /Groups/_postgres RecordName postgres sudo dscl . create /Groups/_postgres RealName "PostgreSQL Users"
So at this point the binaries are installed and there’s a user to run it under, but I needed to initialize a new database and copy back in my saved data. First create the data and log directories and set perms:
sudo mkdir /usr/local/pgsql/data sudo chown postgres:postgres /usr/local/pgsql/data sudo mkdir /usr/local/pgsql/log sudo chown postgres:postgres /usr/local/pgsql/log
Then I logged in as the _postgres user:
sudo su su - _postgres
And initialize database files and start up the database:
/usr/local/pgsql/bin/initdb -E UTF8 -D /usr/local/pgsql/data/ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data/ -l /usr/local/pgsql/log/postgresql.log start
Finally I restored the data from my initial pg_dumpall
/usr/local/pgsql/bin/psql -U postgres -f /tmp/32-bit-dump.sql
I’ve also added these lines into my .profile to add the commands to my path and to simplify starting and stopping the database:
export PATH=$PATH:/usr/local/pgsql/bin export MANPATH=$MANPATH:/usr/local/pgsql/man alias pg_stop='sudo -u postgres pg_ctl -D /usr/local/pgsql/data stop' alias pg_start='sudo -u postgres pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/log/posgtres.log start'
And then finally I could install the postgres rails gem (which was the whole point of this silly excercise):
sudo env ARCHFLAGS="-arch x86_64" gem install pg
I was looking at how perl6 is coming along and found this: http://perlgeek.de/blog-en/perl-5-to-6/ which is really cool. Besides being a really nice presentation of the material (including the “Motivation” section) there’s just lotsa nice stuff. Some of the new way outa here cool perl6 features:
And that’s just a few…
We are building out the new currency frontiers web-site, using the Wagn, which is pretty darn cool. It’s a wiki + database + cms. It’s kinda geeky, but not so much that you have to be a programer to use it (so don’t freak if your aren’t), but if you are a programming inclined, there’s lots of nice stuff you can. Ethan and Lewis are are the excellent chaps wheeling the Wagn. Kudos dudes.
Have just read an excellent blog post on “dumb databases” and the issue of read vs. write consistency. My own mesh & churn for open money comes out of the same realizations that in a distributed environment the way to handle many many issues is to put the responsibility on the reader to verify the validity of the data.
I just realized that Behavior Driven Development is very similar to double entry book-keeping in accounting!Â
Well, I’ve officially joined the git bandwagon.  I’ve put metaform up on github (the open money projects will come soon, but I think probably on gitorious); I’ve been reading tons of articles about git; I installed it on Tiger (use MacPorts) and Leopard (install from source with these instructions but use 1.5.5); and now I’m blogging about it.  The most interesting article so far on git, has made me realize how closely related it is to the mesh and churn…  Quite interesting!
Hey googlers looking for tech-support:
I was trying to install various packages (emacs, etc) from universe on Ubuntu Gutsy (7.10), and I kept getting weird segmentation faults (Setting up emacsen-common (1.4.17) Segmentation fault). Turns out that the problem was that my server was being hosted on a VPS running XEN for virtualization, and you have to first install libc6-xen: apt-get install libc6-xen
Hope this saves someone the half day that it cost me…
Ok, so in a previous post I described the rabit-hole which is switching to rails. Below’s my capistrano deploy script which solves a number of problems:
So here’s what I added to make it work:
desc "Restart the web server and mongrel cluster" task :restart, :roles => :app do sudo "echo 'fish'" #bogus command to make sudo work in the run command run "cd #{current_path} && sudo mongrel_rails cluster::restart" sudo "/usr/local/apache/bin/apachectl graceful" end desc <<-DESC configure the mongrel cluster DESC task :configure_mongrel do run "cd #{current_path} && mongrel_rails cluster::configure -e development -p 9000 -a 127.0.0.1 -P #{shared_path}/pids/mongrel.pid -c #{current_path} -N 2 --user om --group om" end desc <<-DESC configure the mongrel cluster DESC task :configure_database do db_config = "#{shared_path}/config/database.yml" run "cp #{db_config} #{current_path}/config/database.yml" end desc <<-DESC after updating we need to add back in the mongrel configuration file so that when restart is called it will be appropriatly launched. We also need to update the database config file DESC task :after_update, :roles => :app do configure_mongrel configure_database end
The last few days working on the openmoney.info website, I’ve had a major hassle dealing with what appears to be a bug in the html renderer in Firefox.
The issue is that in Firefox, text in a list item won’t wrap around a right floated image; like this:
Code:
<ol style="border: 1px solid #cccccc; width: 300px"> <img src="/images/eric.png" style="float: right" /> <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit,</li> <li>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</li> </ol>
In Safari & Opera the text in the second list item wraps just fine. After an hour of searching the web and trying various things with clear, and in-line, I discovered that the solution was to set the list item width to 100%. In other words, list items take on the width that they start at by default! Crazy. The solution:
<ol style="border: 1px solid #cccccc; width: 300px"> <img src="/images/eric.png" style="float: right" /> <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit,</li> <li style="width:100%">sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</li> </ol>
yields nice wrapping text for the second list item:
If you aren’t viewing this on Firefox, the above two may look identical. That’s the whole point!
[tags]css,firefox,list item,wrap[/tags]
The last month has been quite a trip down the rabbit hole into the new reality of ruby on rails! The promise of a powerful and well designed web application framework was just too much for me to resist, so I decided to leave my own yawaf framework behind (though it has certainly served me well).
So I’m posting this entry for those just starting down this path so you can see what might be on the path ahead of you and what I did to make my way over the learning curve.
So marketing blogger Seth Godin has a mention of SnapMail in the same breath as File Maker Pro on his blog. It’s nice that my humble little program is in such august company, though the context is a bit sad. What’s so odd is how SnapMail was created before the Internet was at all a house-hold word, back in 93, and it still has such a faithful following. I guess there is something valuable about having a little communication tool that’s not on the Internet! Who’da a thunk?
[tags]SnapMail[/tags]
In my on-going quest for good metaphors and ways of thinking about the community/multi-currency world, an excellent metaphor came to me that is useful when talking about all this with programmers:
federal currency = global variables
community currency = local variables
Writing software with only global variables is not impossible, but their “liquidity” (i.e. the fact that they have “value” everywhere) is not an asset, but a liability. Of course an individual variable “loses power” by not being “valuable” everywhere, but its utitlity increases by being only have value in a given context.
The whole programming concept of “scoping” applies to currency!
[tags]currency, programming, scope, community currency, local variable, global variable, money, metaphor[/tags]
I learned about the Aristotelean intellectual virtue of phronesis along with the related term episteme a few years back from Kathryn Montgomery in discussions about her book How Doctors Think. Episteme is the scientific rationality we are all quite familiar with. Phronesis is usually translated “practical wisdom” and is the kind of rational skill doctors and entrepreneurs have that is based on experiential knowledge and provides the ability to take the best action in particular circumstances. We are much less likely to have thought of this as a separate kind of rational capacity.
These terms came up again recently for me in the context of a collective intelligence discussion, which really set my mind going and has led me to some propositions and a conjecture:
Proposition: Whereas the printing press was an episteme engine, the Internet is a phronesis engine.
Alternative long phrasing: The printing press and the Internet are cognitive technologies that provide people and cultures with “mechanical advantage” or leverage for the development of the Aristotelean intellectual virtues of epistome and phronesis respectively.
It’s pretty easy to see how the printing press is responsible for the massive scaling of epistome into the general culture. It’s a bit harder to see how what the Internet is doing is the same for phronesis because our first viewing of the Internet (the web at least) has been that it’s just one giant sales brochure/advertising billboard/encyclopedia/etc, i.e. that it is a global source of knowledge. My proposition is that the key thing going on with the Internet is not access to knowledge, but rather access participation in knowledge processes. Three examples:
In each of these cases the key thing is the shift from access to static information, to active participation in an information process. The Internet is providing a “mechanical advantage” for putting people together in a place where they can jointly engage in the kind of information processes and processing that I think leads to the developing of phronesis.
Proposition: Economic revolutions occur when aspects of production are sufficiently amplified by cognitive technologies that new economic patterns of production come into being. Example: the printing press provided the intellectual infrastructure (a culture of epistome) for the expansion of the simple tools of production during the industrial revolution into what is called Capital in the classical economic sense.
Proposition: There is a new economic revolution under way, the Process Revolution, that is the result of the amplification of information and information processing by the cognitive technology of the Internet, and which is similarly bringing new economic patterns of production into being. These patterns are a new economic factor that can be called Information (capital I), which is defined (analogously to Capital) as the data plus the patterns and processes that use that data to organize production.
Proposition: New economic factors produce competing political systems that are answers to the question: who should own the new economic factor. Example: In the industrial revolution the question was: who should own Capital and the products produced by Capital. Communism proposes common ownership in the form of the State, and Capitalism proposes ownership by individuals.
Proposition: The new economic factor of Information is likewise producing competing approaches to answer who should own it. “Ownerism” which proposes the same answer as Capitalism (ownership by individuals, natural or corporate), and “Commonism” which proposes that its ownership be held in the commons (not by the State).
Proposition: Capitalism won out against Communism for three fundamental philosophical and systemic reasons:
Conjecture: Commonism will win out over Ownersim because it shares with Capitalism the same first two properties as well as another property which is analogous to the third, namely that Commonism works with Information’s natural abundance and it’s tendency to flow everywhere, whereas Ownerism has to fight tooth and nail to keep it scarce and from getting out.
I’ve put together a more detailed presentation of these ideas (including their relation to money) in the form of a paper.
Recently it hit me that I knew of no generalized protocol for sharing the state of an abstract space among a group of computers. I did a quick google search to see if I could find anything, and after coming up dry (which doesn’t mean it doesn’t exist) I decided to slap one together to test out the many uses for this that were readily apparent to me (i.e. any application where multiple users must be able to collaboratively make changes, and become aware of changes made to that space in real time: chat, bulletin boards, network games, etc.)
Of course there is similar stuff like Croquet that certainly does an even more complicated generalized version of this, and lots of single purpose applications, like Subethaedit which must also do thisbut I haven’t found other efforts that are quite as simplistic and generalized.
So, I slapped together the beginings of a protocol as well as a ruby based server, and a RealBasic based clients for OS X and Win to test out the ideas, all of which are released under the GPL license.
[tags]collaboration,FLOSS,sharing[/tags]