<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-15461779</id><updated>2011-07-28T21:01:34.459-04:00</updated><category term='ruby'/><category term='ocaml'/><category term='comet'/><category term='server-push'/><category term='webapp'/><category term='concurrency'/><category term='ajax'/><category term='rails'/><category term='haskell'/><category term='meebo'/><category term='google talk'/><title type='text'>Erlang</title><subtitle type='html'>Things I've done with erlang.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15461779.post-2367288180464870267</id><published>2009-10-18T19:06:00.002-04:00</published><updated>2009-10-18T19:07:47.891-04:00</updated><title type='text'>This blog has moved</title><content type='html'>Since I'd like to talk about more than just Erlang I decided to move to a new location.  Check it out at &lt;a href="http://functional-orbitz.blogspot.com"&gt;http://functional-orbitz.blogspot.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-2367288180464870267?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/2367288180464870267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=2367288180464870267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/2367288180464870267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/2367288180464870267'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2009/10/this-blog-has-moved.html' title='This blog has moved'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-6817727194844520025</id><published>2009-09-06T20:08:00.005-04:00</published><updated>2009-09-06T21:23:59.601-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ocaml'/><category scheme='http://www.blogger.com/atom/ns#' term='haskell'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>Impressed with Haskell's concurrency</title><content type='html'>I have been playing with both Ocaml and Haskell* lately.  In Ocaml, I have been rewriting a lot of simple Python scripts I use at work to see how they compare.  They tend to be faster and more trustworthy.  Ocaml, though, has pretty bad concurrency support.  They have some thread library that wraps the OS threads, no real good message passing interface.  Even the guys at Jane St have listed that as a complaint**.&lt;br /&gt;&lt;br /&gt;So I decided to check out Haskell again.  With Haskell I have always thought it was a great language, but could never grok it.  That sounds a little weird, but reading Haskell code is simply great.  When you figure out what it does, it tends to be very expressive and flexible.  After looking at what Haskell offers for concurrency, I think that in theory it could give Erlang a serious run for its money.  Here's why:&lt;br /&gt;&lt;br /&gt;- Haskell, in general and in my opinion, is a safer language to write code in than Erlang.  One can do a lot of work with Dialyzer to verify their code, but they are still somewhat limited.  Haskells type system is very expressive and powerful.  Haskell also has ADT's, which as far as I know Erlang still does not.  For an idea of why ADT's are so powerful when it comes to writing safe code, see the Caml Trading video.  And in this case, by 'safe' I mean writing correct code.&lt;br /&gt;&lt;br /&gt;- Haskell produces generally fast code.  GHC does some impressive optimizations, and supercompilation*** is most likely getting going to be part of GHC in the near future.  It should noted that while Haskell can produce fast results, its lazyness can also be unpredictable in the optimizations (both speed and memory) that it performs.  This is believed, by many, to be a big drawback to Haskell.  I haven't done enough work in Haskell to really say how bad this is but Real World Haskell does give a complete chapter to diagnosing performance problems and optimizing them.&lt;br /&gt;&lt;br /&gt;- Haskell's threading implementation uses green threads with a many-to-one mapping to OS threads.  This means you can take advantage of multiple cores without modifying your Haskell code.   The Erlang VM does this too, with SMP support.  The greenthread implementation also appears to be blazing fast.  Haskell is number one in the threadring solution on the language shootout.  Erlang is about 4x slower.  Take from that what you will.&lt;br /&gt;&lt;br /&gt;- You can implement Erlang-like best-case programming in Haskell, from what I can tell.  Haskell supports Exceptions, and you can throw exceptions to other threads using asynchronous exceptions.  This gives you a way to 'link' threads like you can link Erlang processes.  It is still programmer driven, so you can make a mistake, point for Erlang.&lt;br /&gt;&lt;br /&gt;- STM, while I haven't read up on this, it seems like a pretty great way to handle synchronization between threads.&lt;br /&gt;&lt;br /&gt;- Monads.  When reading up on concurrency in Haskell, monads seemed to often come up as valuable in ensuring correctness.  For example, in an STM transaction, one wants to restrict the transaction from doing things that cannot be rolled back, such as IO.  This is done by the 'atomically' function taking an STM monad as input and wrapping the output in an IO monad.  What this all means is one can't do IO in the atomically block unless it's unsafe.  The ability to restrict what the user can do, when one wants to, with the type system is quite powerful.&lt;br /&gt;&lt;br /&gt;That being said, Haskell does have some clear losses next to Erlang.  The biggest drawback is the lack of a distributed model.  There is distributed Haskell, I have not researched it much but I'm under the impression it is not 'there' yet.  Erlang is easy to learn, very easy.  Haskell is not.  I have found that, in order to write really good Haskell code, one has to keep a lot of stuff in their head at once.  Perhaps this is just because I am new but I have found Haskell better to read than to write.  Erlang is not like this, while the syntax has some peculiarities to it, it is not hard to pick up and start writing good Erlang.  I think Ocaml shares more in common to Erlang in this regard.  The hump one needs to get over in order to write solid Haskell code is a real and legitimate reason to not choose Haskell.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All that being said, I admittedly am fairly new to Haskell so these opinions will change over time, I'm planning on putting more effort into writing real projects in Haskell to see how it goes.  Needless to say, I am impressed by what Haskell has to offer for concurrency.  If I'm factually wrong on anything here, please correct me, this is all based on some reading research I've been doing on Haskell, not my actual experiences.&lt;br /&gt;&lt;br /&gt;* When I say Haskell, I really mean GHC here&lt;br /&gt;&lt;br /&gt;** Yaron Minsky's Caml Trading lecture, very good! Makes a great, practical argument, for Ocaml - http://ocaml.janestreet.com/?q=node/61&lt;br /&gt;&lt;br /&gt;*** Supercompilation http://community.haskell.org/~ndm/downloads/slides-supercompilation_for_haskell-03_mar_2009.pdf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-6817727194844520025?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/6817727194844520025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=6817727194844520025' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/6817727194844520025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/6817727194844520025'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2009/09/impressed-with-haskells-concurrency.html' title='Impressed with Haskell&apos;s concurrency'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-8824946550078629658</id><published>2008-04-05T01:19:00.003-04:00</published><updated>2008-04-05T01:23:09.599-04:00</updated><title type='text'>Amanda Bynes is awesome</title><content type='html'>Not particularly Erlang related but, &lt;a href="http://en.wikipedia.org/wiki/Amanda_Bynes"&gt;Amanda Bynes&lt;/a&gt; is simply amazing.  I just watched &lt;a href="http://www.imdb.com/title/tt0815244/"&gt;Sydney White&lt;/a&gt;, while it wasn't as awesome as &lt;a href="http://www.imdb.com/title/tt0454945/"&gt;She's The Man&lt;/a&gt;, it did rule.&lt;br /&gt;&lt;br /&gt;Amanda Bynes presents a Hollywood image that all girls can look up to as a &lt;a href="http://en.wikipedia.org/wiki/Role_model"&gt;role model&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;All in all, she rocks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-8824946550078629658?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/8824946550078629658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=8824946550078629658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/8824946550078629658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/8824946550078629658'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2008/04/amanda-bynes-is-awesome.html' title='Amanda Bynes is awesome'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-4619626102283122020</id><published>2008-04-02T10:46:00.005-04:00</published><updated>2008-04-02T11:46:57.675-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='google talk'/><category scheme='http://www.blogger.com/atom/ns#' term='comet'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='meebo'/><category scheme='http://www.blogger.com/atom/ns#' term='server-push'/><category scheme='http://www.blogger.com/atom/ns#' term='webapp'/><title type='text'>Scaling webapps</title><content type='html'>DISCLAIMER: I am not an expert in web apps and simply have been doing some research on them.  Given that, my claims and concerns may be completely unfounded and simply a result of my ignorance of web app design, if so, please let me know.&lt;br /&gt;&lt;br /&gt;I have been doing a little bit of research on webapps and I'm not sure how I feel about the standard model.  The standard model, as I understand it, works by every incoming http request results in some number of DB requests where the DB is the holder of all state information.  The web app itself, whether it be in PHP, or Rails, etc is stateless.  I certainly don't doubt that for a large majority of applications this works fine.  Take something like &lt;a href="http://www.yellowpages.com/"&gt;the yellow pages&lt;/a&gt; which is a Rails application according to &lt;a href="http://www.buildingwebapps.com/articles/13"&gt;this&lt;/a&gt;.  The standard model seems quite reasonable for this.  You have a page that is fairly static, people are mostly doing requests for data which requires walking through some large database and the results are being displayed and not much is happening again until the user initiates another page request.&lt;br /&gt;&lt;br /&gt;Web apps are changing though.  Today, we expect our web apps to look and feel like native applications, which means snappy responses and updates of it even without the user explicitly reloading the page.  We have things like AJAX and &lt;a href="http://en.wikipedia.org/wiki/Comet_%28programming%29"/&gt;Comet&lt;/a&gt;-style serverpush.  In the end, this means more requests are going to the http server even when the user is not doing anything.  The Comet style is pretty neat but from what I can see, polling with AJAX is the most widely used way.  My concern is how well the standard model is going to scale as web apps are required to act more and more like native applications.  The reason for my concern is because this method is simply polling the DB for state changes on every request and in every other situation polling quite clearly has not scaled.  This is the exact reason Comet exists.&lt;br /&gt;&lt;br /&gt;For the sake of simplicity, let's imagine that the web app is AJAX with polling.  Some portion of the page is going to be asking for updates every 5 seconds.  The standard model would have us querying the DB every 5 seconds for that request to see if the state has changed.  If you have a couple thousand people on this page that is a lot of work.  If the component of the page is changing often for a majority of the people then it's not too big of a deal but if it's not changing often for a majority we are doing a lot of worthless DB calls.  I'm sure we would design our database so that this call is hopefully very lightweight but how well does that really scale in the end?&lt;br /&gt;&lt;br /&gt;Now, the reason we want our wep app (such as something in Rails) to be stateless is because for each request we can be pushed around to a separate VM.  So if we hold onto session state information there is a good chance we might not even get a chance to use it on the next request.  On top of that, if you are load balancing between several hosts, you may not even be in a good place to share state information between VMs.&lt;br /&gt;&lt;br /&gt;I'm sure almost all of this is not news to anyone who has made it this far in the post.  What can be done to make a webapp scale better?  I'm not sure but here is my suggestion and hopefully someone with more experience than myself can come back and say if it's a horrible idea or not.  Let's say I want to make a web app that will be handling something like instant messaging such as google talk or meebo (which are both using Comet).&lt;br /&gt;&lt;br /&gt;For starters, I want this to be fairly real time, when I send a message to someone, I want it to get to them ASAP.  Secondly, there will be a lot of interaction between users.  Clearly, page-by-page viewing is not going to work here.  People can't be refreshing their page every few seconds to see if there is an update.  AJAX with polling or Comet are clearly your two choices currently.  How should this look after the HTTP request comes in though?&lt;br /&gt;&lt;br /&gt;Here is how I am suggesting it should:&lt;br /&gt;Each request should have some sort of session ID.  Each session ID will be associated with a process.  By process here, it could be an Erlang process or some OS process written in some other language, whatever.  The point here is, for a particular session ID, its request will get forwarded to the same process every time for the life time of its session.  This way, the process can store all the state information.  We don't have to do worry about sharing state information in something like memcache.  The process would have some sort of timeout value so they die off eventually.  At worst case, we are back to the standard model where if a user does multiple requests that happen to have a pause between them longer than the timeout we now have to initiate a new process and it has to do the DB calls to initiate itself.  In the best case though, we are consistently getting sent to the same process which is holding onto our data.  The upside to this method is the process can also do things specific for that user such as opening up other connections.  For instance, in the instant messaging example,  a user logs in, they get a session ID and a process created for them somewhere that will be mapped to this session ID.  The process opens up a connection to an event server for that user so it can listen for IMs and push IM's out.  We now have an application that is quite event based on all sides of it.  We won't be hitting the DB too often.  Given that we don't really care where this process lives, we can also scale it out to multiple machines and not have to worry about replicating the same data over many machines because we don't know where the users request will go to.&lt;br /&gt;&lt;br /&gt;Downsides?&lt;br /&gt;Certainly.  Clearly if we have 2000 people using our IM application at once, we need to have 2000 processes a live.  If we wrote this in Erlang where each process for a session ID maps to an Erlang process (sorry about the terminology here all)?  That's childsplay.  We could host this application on one machine!  But not everyone wants to write things in Erlang, so what about them?  If I were in this situation, I would probably have some machines each running some amount of applications that will be doing some I/O multiplexing to handle this.  So you would have some amount of OS processes and each one can handle some amount of session ID's.  Pretty standard for something that isn't Erlang but needs to handle a bunch of things at once.  If you are into Python, &lt;a href="http://en.wikipedia.org/wiki/Twisted_%28software%29"&gt;Twisted&lt;/a&gt; comes to mind.  I'm sure other languages have their own way of doing this.&lt;br /&gt;&lt;br /&gt;Another edge case here, and I think this is probably not too hard to deal with, is what if an event comes in (such as an IM) and the process times out due to lack of activity?  You could have each event have a timeout and if it is not ACK'd in that time it gets saved to a DB and the next process that is created for that user picks it up as part of its initiation.  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To reiterate, I do not have much experience in webapps, I simply have been doing some research and this is the impression that I have gotten.  Are my concerns valid?  Is the system I described what people are already going to or is it broken?  How would someone write Meebo or google talk?  Let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-4619626102283122020?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/4619626102283122020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=4619626102283122020' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/4619626102283122020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/4619626102283122020'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2008/04/scaling-webapps.html' title='Scaling webapps'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-5061080681220019513</id><published>2008-03-19T11:18:00.004-04:00</published><updated>2008-03-19T16:01:48.034-04:00</updated><title type='text'>Back in the saddle</title><content type='html'>So I have been working on Wall Street for the last year+ and last week decided to quit my job.  And non-too-soon, as my job will most likely no longer exist in a few months if you have been following the news over the past few weeks.&lt;br /&gt;&lt;br /&gt;I am going back to school, moving out of NYC and off to Maryland so over this summer I should have a lot of free time and I am working on possibly being involved in sort of a freelance project in order to make money (details are still pending).  Anyways, the current design of the project has a typical web-app interface, then a manager layer that encapsulates the database.  The manager layer handles caching data and moving it back to the database when needed, and event dispatching, blah blah blah.&lt;br /&gt;&lt;br /&gt;Immediately I think this is the perfect use case for Erlang.  We want it to be fault tolerant of course (the downside of a web-app is when things go wrong it affects everyone) and be able to handle a lot of data moving back and forth (although I'm unsure of the specifics since this is so early).  Basically this sounds like a standard Erlang app with mnesia as the cache most likely, spanning a few nodes and moving data back to a DB in a write-behind method.&lt;br /&gt;&lt;br /&gt;Some people have a bit of a concern about Erlang, how will we find developers and so on, which are perfectly valid.  My response to that is:&lt;br /&gt;Erlang is such a simple language it does not take much time to learn, and while OTP is not as simple, it does not take much time to learn either.  In the end, one needs to be less of an expert in Erlang to get an equal or better application (in terms of Erlang's strengths) than they would have to be in another language such as Java.&lt;br /&gt;&lt;br /&gt;One possible alternative language being considered is Java because of JBoss.  I haven't looked into JBoss in-depth yet, but at a quick glance it looks like it has some really nice and really mature features.  The JMS implementation sounds pretty solid and the clustering.  Everyone knows Java, or at least puts it on their CV, but this sounds misleading.  How good does one need to be in Java in order to not make a mess of an application written using JBoss compared to Erlang?  My opinion is that the way one learns Erlang is fairly similar to how they would write production software with Erlang, but perhaps not the same for Java.  The features we use in our 'Hello World' are the same that we use in a production environment, this is not true of Java in my experience.&lt;br /&gt;&lt;br /&gt;We are still looking into things but I'm currently hoping for Erlang.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-5061080681220019513?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/5061080681220019513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=5061080681220019513' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/5061080681220019513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/5061080681220019513'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2008/03/back-in-saddle.html' title='Back in the saddle'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-363115630238166319</id><published>2008-01-25T23:03:00.000-05:00</published><updated>2008-01-25T23:13:33.774-05:00</updated><title type='text'>Erlang Job Advert</title><content type='html'>Well, it's been over a year, sorry.  Today I received an email with an Erlang job offer for a company based in Boston.  I don't know anything about the company at all, perhaps it is junk, but the project seems like something Erlang is good at.  It's a telecommuting job, so that might raise a red flag with some people.  If you are interested I'll put you in touch with the recruiter or whatever he is, email me at orbitz AT ortdotlove.net (that is really ortdotlove.net, not fancy spelling for ort.love.net).&lt;br /&gt;&lt;br /&gt;Here are the job details:&lt;br /&gt;&lt;blockquote&gt;Job Description:&lt;br /&gt;&lt;br /&gt;Our client, who is based in Boston, is seeking an adept Erlang developer to help build a next generation metrics and monitoring system on the GNU/Linux platform. This system will watch and report on hundreds and thousands of systems, ranging from network devices to servers to software applications.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Required Skills:&lt;br /&gt;&lt;br /&gt;·         Must have experience with the Erlang programming language&lt;br /&gt;&lt;br /&gt;·         Must have expert level network programming experience, preferably in Erlang, C++ and/or C&lt;br /&gt;&lt;br /&gt;·         Strong background in developing on GNU/Linux for mission-critical production deployments&lt;br /&gt;&lt;br /&gt;·         Strong understanding of MySQL 4.1-5.x, including database design patterns&lt;br /&gt;&lt;br /&gt;·         Strong experience programming network servers/clients, including knowledge of fundamental protocols such as TCP, UDP, IPV4/6, and SSL/TLS&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-363115630238166319?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/363115630238166319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=363115630238166319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/363115630238166319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/363115630238166319'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2008/01/erlang-job-advert.html' title='Erlang Job Advert'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-116407703914434943</id><published>2006-11-20T21:14:00.000-05:00</published><updated>2006-11-20T23:13:37.553-05:00</updated><title type='text'>Cryptogram solver</title><content type='html'>Newspaper puzzles beware.  I have been working on soving newspaper cryptograms for the past few days in my free time.  It is a bit more interesting of a problem to solve than sudoku I think.  The algorithm I've implementing is nothing alltogether impressive and it relies on a good dictionary file to get solutions.&lt;br /&gt;&lt;br /&gt;The algorithm works like so:&lt;br /&gt;First you need an index which is a map of abstract words to lists of words.&lt;br /&gt;An abstract word is taking a word and turning it into a pattern, for instance, 'cat' has the pattern '123',  as does 'hat', and 'fat'.  'mom' has the pattern '121'.&lt;br /&gt;&lt;br /&gt;Then it takes the sentence you have given it, splits it on spaces.&lt;br /&gt;Popping the first word off the list, finds the list in the index of possible words it could be, iterates over it generating a map of letters to letters and recurses on the rest of the sentence, once it has reached the end of the sentence it puts the map it has generated into a list of possible solutions.  If a generated map for a word conflicts with teh current map it is not a valid solution and moves onto the next possible solution.&lt;br /&gt;The solve function returns a list of solution maps that can eb applied to any sentence to get the result.&lt;br /&gt;&lt;br /&gt;Little things that make it helpful include being able to give an intial map, if you are sure some letters map to other letters you can give that as a hint.  It can also remove any words whos pattern does not appear in the map.&lt;br /&gt;&lt;br /&gt;Todo:&lt;br /&gt;Solve only those subsets of words that, if solved, will result in the entire alphabet being solved.  It should do this for all possible combinations of words in teh sentence that will result in this.  This is not an optimizations, it should probably make it take longer to solve actually, however it allows it to solve sentences with words that might not exist in the dictionary but could come about as a result of solving the other words.  I have a few ideas of how to do this but havn't had time to implement it yet.&lt;br /&gt;&lt;br /&gt;The current code can be downloaded &lt;a href="http://ortdotlove.net/~orbitz/temp/crypto.erl"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-116407703914434943?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/116407703914434943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=116407703914434943' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/116407703914434943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/116407703914434943'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/11/cryptogram-solver.html' title='Cryptogram solver'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-116356045127971344</id><published>2006-11-14T22:00:00.000-05:00</published><updated>2006-11-14T22:46:13.636-05:00</updated><title type='text'>Sudoku</title><content type='html'>I've got sudoku fever!  Actually, no, I don't, I don't really like sudoku at all but I decided to write a solver in erlang.  It was pretty trivial.  The basic algorithm is as follows:&lt;br /&gt;1) Create a list of every blank square and the possible values that can go into that square&lt;br /&gt;2) Find the square with the least number of possible values&lt;br /&gt;3) Iterate over the list of possible numbers that can be in that square, create a new board with that value in it and recurse on the new board&lt;br /&gt;4) Continue until there are no more possible values (in which case it failed) or the puzzle is solved.&lt;br /&gt;&lt;br /&gt;The code is not the prettiest stuff in the world but it appears to solve the problem (specifically the remove_* functions).&lt;br /&gt;&lt;br /&gt;Usage looks like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Eshell V5.5.1  (abort with ^G)&lt;br /&gt;1&gt; {solved, Res} = sudoku:solve([&lt;br /&gt;1&gt; [9, 5, b, b, b, 6, 4, 7, b],&lt;br /&gt;1&gt; [4, b, 8, 7, b, 2, b, b, b],&lt;br /&gt;1&gt; [6, 2, b, 4, b, b, b, 5, b],&lt;br /&gt;1&gt; [5, b, 2, b, 6, b, 3, b, b],&lt;br /&gt;1&gt; [b, b, b, 2, b, 7, b, b, b],&lt;br /&gt;1&gt; [b, b, 4, b, 1, b, 2, b, 8],&lt;br /&gt;1&gt; [b, 7, b, b, b, 9, b, 3, 4],&lt;br /&gt;1&gt; [b, b, b, 1, b, 3, 7, b, 5],&lt;br /&gt;1&gt; [b, 4, 3, 5, b, b, b, 2, 9]]).&lt;br /&gt;...&lt;br /&gt;2&gt; sudoku:print(Res).&lt;br /&gt;9 5 1 8 3 6 4 7 2 &lt;br /&gt;4 3 8 7 5 2 9 6 1 &lt;br /&gt;6 2 7 4 9 1 8 5 3 &lt;br /&gt;5 8 2 9 6 4 3 1 7 &lt;br /&gt;3 1 9 2 8 7 5 4 6 &lt;br /&gt;7 6 4 3 1 5 2 9 8 &lt;br /&gt;8 7 5 6 2 9 1 3 4 &lt;br /&gt;2 9 6 1 4 3 7 8 5 &lt;br /&gt;1 4 3 5 7 8 6 2 9 &lt;br /&gt;ok&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Code (can be downloaded &lt;a href="http://ortdotlove.net/~orbitz/temp/sudoku.erl"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;-module(sudoku).&lt;br /&gt;&lt;br /&gt;-export([solve/1, print/1]).&lt;br /&gt;&lt;br /&gt;solve(Puzzle) when is_list(Puzzle) -&gt;&lt;br /&gt;    solve_puzzle(dict_from_list(Puzzle)).&lt;br /&gt;&lt;br /&gt;print(Puzzle) -&gt;&lt;br /&gt;    lists:foreach(fun(X) -&gt;&lt;br /&gt;                          lists:foreach(fun(Y) -&gt;&lt;br /&gt;                                                io:format("~w ", [dict:fetch({X, Y}, Puzzle)])&lt;br /&gt;                                        end, lists:seq(0, 8)),&lt;br /&gt;                          io:format("~n", [])&lt;br /&gt;                  end, lists:seq(0, 8)).&lt;br /&gt;                          &lt;br /&gt;dict_from_list(List) -&gt;&lt;br /&gt;    element(2, lists:foldl(fun(Elm, {X, Dict}) -&gt;&lt;br /&gt;                                   {_, DDict} = lists:foldl(fun(Elem, {Y, NDict}) -&gt;&lt;br /&gt;                                                                    {Y + 1, dict:store({X, Y}, Elem, NDict)}&lt;br /&gt;                                                            end, {0, Dict}, Elm),&lt;br /&gt;                                   {X + 1, DDict}&lt;br /&gt;                           end, {0, dict:new()}, List)).&lt;br /&gt;&lt;br /&gt;solve_puzzle(Puzzle) -&gt;&lt;br /&gt;    case generate_open_spots(Puzzle) of&lt;br /&gt;        [{{X, Y}, Set} | _] -&gt;&lt;br /&gt;            try_value({X, Y}, Set, Puzzle);&lt;br /&gt;        [] -&gt;&lt;br /&gt;            {solved, Puzzle}&lt;br /&gt;    end.&lt;br /&gt;&lt;br /&gt;try_value(_, [], Puzzle) -&gt;&lt;br /&gt;    print(Puzzle),&lt;br /&gt;    io:format("~n", []),&lt;br /&gt;    failed;&lt;br /&gt;try_value({X, Y}, [H | R], Puzzle) -&gt;&lt;br /&gt;    case solve_puzzle(dict:store({X, Y}, H, Puzzle)) of&lt;br /&gt;        {solved, RPuzzle} -&gt;&lt;br /&gt;            {solved, RPuzzle};&lt;br /&gt;        failed -&gt;&lt;br /&gt;            try_value({X, Y}, R, Puzzle)&lt;br /&gt;    end.&lt;br /&gt;                      &lt;br /&gt;generate_open_spots(Puzzle) -&gt;&lt;br /&gt;    OpenSquareList = dict:fold(fun(Key, b, Acc) -&gt;&lt;br /&gt;                                       [Key | Acc];&lt;br /&gt;                                  (_Key, _Value, Acc) -&gt;&lt;br /&gt;                                       Acc&lt;br /&gt;                               end, [], Puzzle),&lt;br /&gt;    lists:sort(fun({{_X1, _Y1}, E1}, {{_X2, _Y2}, E2}) when length(E1) &lt; length(E2) -&gt;&lt;br /&gt;                       true;&lt;br /&gt;                  (_E1, _E2) -&gt;&lt;br /&gt;                       false&lt;br /&gt;               end, generate_open_values(OpenSquareList, Puzzle)).&lt;br /&gt;&lt;br /&gt;generate_open_values(List, Puzzle) -&gt;&lt;br /&gt;    generate_open_values(List, [], Puzzle).&lt;br /&gt;&lt;br /&gt;generate_open_values([], Acc, _Puzzle) -&gt;&lt;br /&gt;    Acc;&lt;br /&gt;generate_open_values([{X, Y} | R], Acc, Puzzle) -&gt;&lt;br /&gt;    generate_open_values(R, [{{X, Y}, remove_region_vals({X, Y},&lt;br /&gt;                                                         remove_x_vals(Y,&lt;br /&gt;                                                                       remove_y_vals(X, lists:seq(1, 9),&lt;br /&gt;                                                                                     Puzzle),&lt;br /&gt;                                                                       Puzzle),&lt;br /&gt;                                                         Puzzle)} | Acc],&lt;br /&gt;                         Puzzle).&lt;br /&gt;&lt;br /&gt;remove_x_vals(Y, List, Puzzle) -&gt;&lt;br /&gt;    lists:foldl(fun(Idx, Acc) -&gt;&lt;br /&gt;                        case dict:fetch({Idx, Y}, Puzzle) of&lt;br /&gt;                            b -&gt;&lt;br /&gt;                                Acc;&lt;br /&gt;                            E -&gt;&lt;br /&gt;                                lists:delete(E, Acc)&lt;br /&gt;                        end&lt;br /&gt;                        end,&lt;br /&gt;                        List, lists:seq(0, 8)).&lt;br /&gt;&lt;br /&gt;remove_y_vals(X, List, Puzzle) -&gt;&lt;br /&gt;    lists:foldl(fun(Idx, Acc) -&gt;&lt;br /&gt;                        case dict:fetch({X, Idx}, Puzzle) of&lt;br /&gt;                            b -&gt;&lt;br /&gt;                                Acc;&lt;br /&gt;                            E -&gt;&lt;br /&gt;                                lists:delete(E, Acc)&lt;br /&gt;                        end&lt;br /&gt;                        end,&lt;br /&gt;                        List, lists:seq(0, 8)).&lt;br /&gt;&lt;br /&gt;remove_region_vals({X, Y}, List, Puzzle) -&gt;&lt;br /&gt;    {RX, RY} = find_region(X, Y),&lt;br /&gt;    lists:foldl(fun(IX, AccX) -&gt;&lt;br /&gt;                        lists:foldl(fun(IY, AccY) -&gt;&lt;br /&gt;                                            case dict:fetch({IX, IY}, Puzzle) of&lt;br /&gt;                                                b -&gt;&lt;br /&gt;                                                    AccY;&lt;br /&gt;                                                E -&gt;&lt;br /&gt;                                                    lists:delete(E, AccY)&lt;br /&gt;                                            end&lt;br /&gt;                                    end, AccX, lists:seq(RY, RY + 2))&lt;br /&gt;                        end, List, lists:seq(RX, RX + 2)).&lt;br /&gt;&lt;br /&gt;find_region(X, Y) -&gt;&lt;br /&gt;    {find_region(X), find_region(Y)}.&lt;br /&gt;&lt;br /&gt;find_region(V) when V &gt;= 0, V &lt; 3 -&gt;&lt;br /&gt;    0;&lt;br /&gt;find_region(V) when V &gt;= 3, V &lt; 6 -&gt;&lt;br /&gt;    3;&lt;br /&gt;find_region(V) when V &gt;= 6, V &lt; 9 -&gt;&lt;br /&gt;    6.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-116356045127971344?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/116356045127971344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=116356045127971344' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/116356045127971344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/116356045127971344'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/11/sudoku.html' title='Sudoku'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-115333711399021067</id><published>2006-07-19T14:28:00.000-04:00</published><updated>2006-07-19T15:25:15.600-04:00</updated><title type='text'>Lack of activity</title><content type='html'>I have been busy looking for a job so I have had not had much time to do anything Erlang related.  This, unfortunately, means I have not had much time to blog.  I am hoping this will change by Sept.  If anyone has any job offers and wants a resume,  I am currently looking in the New York Ciy area for Financial Programming work or Bioinformatics work.  Send an email to orbitz AT ortdotlove.net   (that is really ortdotlove.net, not fancy spelling for ort.love.net).  I'll gladly mail you back my resume.&lt;br /&gt;&lt;br /&gt;I'm looking forward to getting back to programming for fun soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-115333711399021067?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/115333711399021067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=115333711399021067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/115333711399021067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/115333711399021067'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/07/lack-of-activity.html' title='Lack of activity'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114896468988947308</id><published>2006-05-30T00:43:00.000-04:00</published><updated>2006-05-30T00:51:29.903-04:00</updated><title type='text'>Shell</title><content type='html'>The other day, araujo suggested Erlang might make a good shell.  Shell as in, bash.  Hrm, I thought, maybe...&lt;br /&gt;I don't think Erlang would be flexible enough to make a decent shell.  Take something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;for i in *; do echo $i; done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What would the Erlang equivalent look like?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;lists:map(fun(X) -&gt; print([X]) end, ls())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I just don't see it?  I should hope it doesn't look like that but I don't know.  On the other hand, I seem to have it pretty set in my mind that Common Lisp would make an excellent shell language.  A few people have told me that CL would probably be too verbose and not work out well but,  I don't know, it just seems so succinct and powerful.  You could make a lot of macros to make your life easier.  I sent an email to the Lisp At Light Speed blog dude to get his opinion but I figured I'd post it here too to see if anyone has any thoughts.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;What I have in mind is basically an interactive shell, using Common&lt;br /&gt;Lisp as its programming language.  For instance something like:&lt;br /&gt; &lt;br /&gt;for i in *; do echo $i; done&lt;br /&gt; &lt;br /&gt;Might look like:&lt;br /&gt; &lt;br /&gt;(loop for i in (ls) do (print i))&lt;br /&gt; &lt;br /&gt;The second thing I would love to see is Monad/Powershell.  Rather&lt;br /&gt;than using text to pass data around, uses lists/objects/etc.  (ls)&lt;br /&gt;for instance gives a list of file objects to iterate over, and you&lt;br /&gt;can extract things like the size and permissions and what not.&lt;br /&gt; &lt;br /&gt;This raises a question though. In order to do this, just about every&lt;br /&gt;standard program becomes obsolete. For instance, why use 'cut' when&lt;br /&gt;you can simply split a string with a CL function.  However some&lt;br /&gt;things would still be very useful, such as ls, or grep, but these&lt;br /&gt;now need to communicate via objects rather than just text, so those&lt;br /&gt;will have ot be rewritten.  In which cause it seems like they could&lt;br /&gt;simply be packages and loaded into the shell, meaning you don't&lt;br /&gt;have to deal with program startup times or what not.  Is this a lot&lt;br /&gt;of work to rewrite all of these programs, and does it mean that we&lt;br /&gt;cannot usefully use third party programs that people write?  You&lt;br /&gt;can always drop down to using strings as communication I suppose.&lt;br /&gt; &lt;br /&gt;That is the basic idea.  So far a few people have suggested that&lt;br /&gt;sexprs really aren't any better for this sort of thing.  sexpr's&lt;br /&gt;won't be any better than say...bash.  Someone suggested that Factor&lt;br /&gt;might be a better language for this.  But it seems to me, with&lt;br /&gt;Common Lisps powerful macro system, you can easily make most&lt;br /&gt;operations incredibly simple?  The most useful aspect would be using&lt;br /&gt;objects to communicate.  But even if this is a lot of work to&lt;br /&gt;accomplish, it seems to me that simply using CL as a shell programming&lt;br /&gt;language seems like it would be nice. Am I wrong here? Am I missing&lt;br /&gt;something?&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If CL would make a poor langauge, what would make a good language?  Riastrach has suggested Factor.  I don't know enough about factor to say that but I think I like CL better for this.&lt;br /&gt;&lt;br /&gt;All I know is:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://squirrelsh.sourceforge.net/"&gt;This is not the answer&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114896468988947308?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114896468988947308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114896468988947308' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114896468988947308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114896468988947308'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/05/shell.html' title='Shell'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114698016775551336</id><published>2006-05-06T23:27:00.000-04:00</published><updated>2006-05-07T01:36:07.793-04:00</updated><title type='text'>Pastebin design - Mnesia tables</title><content type='html'>I have started to design the tables for this.  The main goal is simple: make it easily extendable.  That is to say I want to make it so I can easily develope it incrementally and add things to it that I didn't think of before.  But that should be obvious to any developer.  Given the spec of my previous post, here is the beginning of the database.&lt;br /&gt;&lt;br /&gt;Table:&lt;br /&gt;paste - This is the table that will hold the actual pastes.  &lt;br /&gt;pid | text | annotation | language | date&lt;br /&gt;&lt;br /&gt;pid - unique id to identify a paste&lt;br /&gt;text - the actual text&lt;br /&gt;annotation - any annotation the paster wants to include&lt;br /&gt;language - Plaintext/C++/Erlang, etc&lt;br /&gt;date - when they pasted it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;highlight - cache of pastes that have been put through the source highlighter&lt;br /&gt;pid | text | last_viewed&lt;br /&gt;&lt;br /&gt;pid - the same as paste.pid&lt;br /&gt;text - result of being put through the highlighter&lt;br /&gt;last_viewed - to keep track of when the entry should be removed&lt;br /&gt;&lt;br /&gt;threads - paste threads&lt;br /&gt;tid | [pid]&lt;br /&gt;&lt;br /&gt;tid - the unique id for a thread&lt;br /&gt;[pid] - list of pid's&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I decided to have the thread table just contain an id and list so you don't have to do a bunch of queries to get every paste in a thread.  This way a paste can be part of multiple threads (Although I don't see when this will ever happen).    The paste table contains, I think, the minimalist amount of data in order to be useful.  Using a highlight table means we can store, if we want, every single paste with a highlighted copy of the text, or just a few and use it as a cache style system.  Later on we can also add the ability to associate a paste with an irc channel or a user if we wish to track that sort of information.&lt;br /&gt;&lt;br /&gt;I'm not sure how to generate unique id's in mnesia.  In a SQL database I would use a serial data type but I am unsure if mnesia supports this functionality.  If not I suppose I could use newref maybe?  I need to be able to convert it to a string to make url's, and also be valid between restarts.&lt;br /&gt;&lt;br /&gt;As I think about it, I guess serials are just implemented as a table and store the integer in there, I can implement that in mnesia I suppose.  It just needs to have some sort of get_and_increment functionality so two proceses don't get the same idea.  If anyone has any ideas on how to implement this let me know.  Bear in mind I have not looked at the mnesia documentation yet and am just brainstorming, so it is quite possible the solution is incredibly simple.&lt;br /&gt;&lt;br /&gt;Next step - determine what pages pages will be needed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114698016775551336?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114698016775551336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114698016775551336' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114698016775551336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114698016775551336'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/05/pastebin-design-mnesia-tables.html' title='Pastebin design - Mnesia tables'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114672252332871282</id><published>2006-05-04T01:08:00.000-04:00</published><updated>2006-05-04T06:24:38.526-04:00</updated><title type='text'>Erlang Pastebin</title><content type='html'>I have always wanted to make a pastebin for some reason.  When I first started looking at nevow, I wanted to make one in that however mg beat me to it (and made a kickass one at that).  So now I have been looking at yaws and think it would be a good project.  Perhaps it can be packaged along with the wiki and chat client.  I think my pastebin is a bit ambitious, but I would like to design it in such a way that it can all be added incrementally so I can have a functional pastebin and add onto it.&lt;br /&gt;&lt;br /&gt;For starters, I would like a nice clean layout.  I am going to do my best to use CSS and valid HTML for all of this.  I am hoping petekaz can possibly help out with this.  I am going to write it with everything in a div tags with proper ids so it should be easy to give this thing a skin eventually.&lt;br /&gt;&lt;br /&gt;Technical Features:&lt;br /&gt;Syntax highlighting - As with any pastebin this will most likely be used for code 90% of the time.  For all of those languages we need syntax highlighting so they are easy to read.  I have found a program, I beleive it is just called 'highlight'.  It handles 100+ languages, including all of the ones I have an interst in supporting so I can simply interface to that.&lt;br /&gt;&lt;br /&gt;Documentation links - People seem to want this.  I am not sure how easy it is to support, especially if you want to support a lot of languages.  It's a thought but not on the top of my list.&lt;br /&gt;&lt;br /&gt;Annotation - Instead of putting suplimentery information in comments of the paste, just having a section for such information would be nice.&lt;br /&gt;&lt;br /&gt;Threads for pastes - lisppaste does this I beleive.  A paste should be like a discussion.  "Here this doesn't compile" "You have a mistake here, this fix will work" "Ok, but now I have a problem here" "Ok do this".  Each post in a paste thread will have the paste + annotation.  To reply, since you are generally going to simply be making small changes to the previous post, the paste section should be populated with that already.&lt;br /&gt;&lt;br /&gt;Compile code for your language - I am not sure how to do this safely, if at all.  It would be nice to provide a gcc interface and an erlc interface and a ghc, yadda yadda.  But I am not going to put my system at risk just for this feature that shouldn't be needed all too much in the first place.&lt;br /&gt;&lt;br /&gt;Interface to any erlang app - By providing a node + a process name, this should be able to send a message that  paste is ready to any erlang node.  The obvious first usage of this would be an IRC bot.  The main problem I see with this is, depending on what application the data is sent to, that will affect the look of the pastebin.  For example, if the events are sent to an IRC bot, you want to be able to select what channel the notification gets sent to for the IRC bot.  Should I just hardcode this into the pastebin or provide some way for the IRC bot to register information with the pastebin and somehow have the pastebin display the information on the web app?  This sounds a bit harder, but works better with any application (But what other applications would even want notification of a paste?).  Perhaps I will hard code it at first and then move towards a more dynamic system as I figure out how.&lt;br /&gt;&lt;br /&gt;Mnesia configuration - I like to use mnesia for my configuration.  I have a config module which provides functions to be used in setting/getting values from the mnesia config data base.  I also want to use mnesia to store all of the information for the actual pastes.  I hear mnesia falls apart after store a lot of data, I can imagine some of these pastes will grow to be a fair size, so I am considering using a cache for the syntax highlighted pastes.  Running the application to highlight the text on every hit sounds inefficient, and storing it for every paste sounds like a waste of space, so a cache is probably a good inbetween.  Right now I would like to store as many pastes as I can but will consider deleting those that are too old.&lt;br /&gt;&lt;br /&gt;Download paste - Being able to download the paste is always very helpful.  Providing a nice filename that ends in the proper extension for the language would be nice.&lt;br /&gt;&lt;br /&gt;Browsing recent pastes - You paste to my site you loste all privacy, go figure.&lt;br /&gt;&lt;br /&gt;File upload - Somtimes it is easier to just upload a file rather than pasting.&lt;br /&gt;&lt;br /&gt;This sounds like a lot but I don't think it will be too bad.  It seems like I should be able to do most of it fairly modular.&lt;br /&gt;&lt;br /&gt;Step one - Come up with mnesia tables, do some research on mnesia in terms of foreign keys and possibly how to do decent QLC queries.  I think learning QLC will be important, especially when a lot of pastes get put into this thing.&lt;br /&gt;&lt;br /&gt;Step two - Get the basic form for uploading going&lt;br /&gt;&lt;br /&gt;Step three - Come up with step three when I get there.&lt;br /&gt;&lt;br /&gt;UPDATE&lt;br /&gt;Some obvious ideas were brought to my attention&lt;br /&gt;&lt;br /&gt;Indent - Running various languages through astyle and friends would be very helpful, some people just can't indent properly.&lt;br /&gt;&lt;br /&gt;Customize with cookies - Store various color information in cookies so people can keep colors they enjoy.  This probably won't be implemented until much later.&lt;br /&gt;&lt;br /&gt;Differences - Highlight differences between pastes so you can show what changes have been made.  This sounds kind of difficult, especially if I am outsourcing the highlighting to a third party.&lt;br /&gt;&lt;br /&gt;Line numbers - This should be obvious&lt;br /&gt;&lt;br /&gt;Non GUI Browsers - Yes some people use these.  The download as text option should be helpful for these people, but the probably also want line numbers so a specific Non GUI version of the code might be nice, this will include line numbers.  &lt;br /&gt;&lt;br /&gt;RSS - This certainly isn't a need but might be nice, especialy as the maintainer I might want to keept track of who's pasting what.&lt;br /&gt;&lt;br /&gt;Intelligent Mouseovers - Showing balanced paren when the mouse is over&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114672252332871282?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114672252332871282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114672252332871282' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114672252332871282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114672252332871282'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/05/erlang-pastebin.html' title='Erlang Pastebin'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114419760449698203</id><published>2006-04-04T20:24:00.000-04:00</published><updated>2006-04-04T20:40:04.513-04:00</updated><title type='text'>Yaws 1.58 true_nozip bug</title><content type='html'>Yaws 1.58 has a bit of a bug.  If you specify dir_listings = true_nozip, it poops out.  This is because the if condition is written to only handle the situation where it is true or false.&lt;br /&gt;&lt;br /&gt;Here is my little bug fix, the problem file is src/yaws_ls.erl&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;47c47,54&lt;br /&gt;&lt;            if DoAllZip == true -&gt; allzip() end,&lt;br /&gt;---&lt;br /&gt;&gt;            case DoAllZip of&lt;br /&gt;&gt;                  true -&gt;&lt;br /&gt;&gt;                      allzip();&lt;br /&gt;&gt;                  true_nozip -&gt;&lt;br /&gt;&gt;                      [];&lt;br /&gt;&gt;                  false -&gt;&lt;br /&gt;&gt;                      []&lt;br /&gt;&gt;              end,&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;klacke says he also has a fix but, as usual, sourceforge is down so he has not been able to commit it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114419760449698203?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114419760449698203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114419760449698203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114419760449698203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114419760449698203'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/04/yaws-158-truenozip-bug.html' title='Yaws 1.58 true_nozip bug'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114384501342651754</id><published>2006-03-31T17:04:00.000-05:00</published><updated>2006-04-01T02:10:53.070-05:00</updated><title type='text'>Fun with processes (Updated)</title><content type='html'>I really need to go through all of my Erlang documentation so people like petekaz can stop making me feel small.&lt;br /&gt;I had an issue with some poor Erlang code I was running where it performed a file:open but not the appropriate file:close.  Not wanting to restart my application I wanted to know how I could fix this problem without shutting it down.  Erlang, of course, provides a solution.&lt;br /&gt;One thing that made this workable in the first place was the fact that I had no other open files besides those that needed to be closed.&lt;br /&gt;&lt;br /&gt;So imagine for a second you have opened a number of files and lost the reference to them.  For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(ort_bot@blong)21&gt; [file:open("/tmp/c2.log", read) || X &lt;- lists:seq(1, 10)].&lt;br /&gt;[{ok,&lt;0.8974.7&gt;},&lt;br /&gt; {ok,&lt;0.8975.7&gt;},&lt;br /&gt; {ok,&lt;0.8976.7&gt;},&lt;br /&gt; {ok,&lt;0.8977.7&gt;},&lt;br /&gt; {ok,&lt;0.8978.7&gt;},&lt;br /&gt; {ok,&lt;0.8979.7&gt;},&lt;br /&gt; {ok,&lt;0.8980.7&gt;},&lt;br /&gt; {ok,&lt;0.8981.7&gt;},&lt;br /&gt; {ok,&lt;0.8982.7&gt;},&lt;br /&gt; {ok,&lt;0.8983.7&gt;}]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;file:open causes a process to be created (this is Erlang afterall).&lt;br /&gt;In the shell you can simply type i(). and get output like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(ort_bot@blong)22&gt; i().&lt;br /&gt;Pid                   Initial Call                          Heap     Reds Msgs&lt;br /&gt;Registered            Current Function                     Stack              &lt;br /&gt;&lt;0.0.0&gt;               otp_ring0:start/2                      377     6569    0&lt;br /&gt;init                  init:loop/1                              2              &lt;br /&gt;&lt;0.2.0&gt;               erlang:apply/2                        4181   179350    0&lt;br /&gt;erl_prim_loader       erl_prim_loader:loop/3                   5              &lt;br /&gt;&lt;0.4.0&gt;               gen_event:init_it/6                   1597     1114    0&lt;br /&gt;error_logger          gen_event:loop/4                        10              &lt;br /&gt;&lt;0.5.0&gt;               erlang:apply/2                        6765     8325    0&lt;br /&gt;application_controlle gen_server:loop/6                        7              &lt;br /&gt;&lt;0.7.0&gt;               application_master:init/4              377       45    0&lt;br /&gt;                      application_master:main_loop/2           8              &lt;br /&gt;&lt;0.8.0&gt;               application_master:start_it/4          233       90    0&lt;br /&gt;                      application_master:loop_it/4             5              &lt;br /&gt;&lt;0.9.0&gt;               supervisor:kernel/1                    610     1373    0&lt;br /&gt;kernel_sup            gen_server:loop/6                       12              &lt;br /&gt;&lt;0.10.0&gt;              rpc:init/1                             610 17456475    0&lt;br /&gt;rex                   gen_server:loop/6                       12              &lt;br /&gt;&lt;0.11.0&gt;              global:init/1                          233     1246    0&lt;br /&gt;global_name_server    gen_server:loop/6                       12              &lt;br /&gt;&lt;0.12.0&gt;              erlang:apply/2                         233      275    0&lt;br /&gt;                      global:loop_the_locker/1                 4              &lt;br /&gt;&lt;0.13.0&gt;              erlang:apply/2                         233        4    0&lt;br /&gt;                      global:collect_deletions/2               6              &lt;br /&gt;&lt;0.14.0&gt;              inet_db:init/1                         233      137    0&lt;br /&gt;inet_db               gen_server:loop/6                       12              &lt;br /&gt;&lt;0.16.0&gt;              supervisor:erl_distribution/1          377      307    0&lt;br /&gt;net_sup               gen_server:loop/6                       12              &lt;br /&gt;&lt;0.17.0&gt;              erl_epmd:init/1                        233      137    0&lt;br /&gt;erl_epmd              gen_server:loop/6                       12              &lt;br /&gt;&lt;0.18.0&gt;              auth:init/1                            233       77    0&lt;br /&gt;auth                  gen_server:loop/6                       12              &lt;br /&gt;&lt;0.19.0&gt;              net_kernel:init/1                      233     3272    0&lt;br /&gt;net_kernel            gen_server:loop/6                       12              &lt;br /&gt;&lt;0.20.0&gt;              inet_tcp_dist:accept_loop/2            233      178    0&lt;br /&gt;                      prim_inet:accept0/2                     10              &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This list goes on for awhile longer, depending on what you have done. As you scan through this output you should see something like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;0.8974.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8975.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8976.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8977.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8978.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8979.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8980.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8981.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8982.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3              &lt;br /&gt;&lt;0.8983.7&gt;            erlang:apply/2                         233      135    0&lt;br /&gt;                      file_io_server:server_loop/1             3   &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All of those file_io_server's are the open files.  And the Pid associated with it is the file handle.  So to close all these files all you have to do is call file:close on those pids.  You can create a pid give 3 numbers in the shell by using the pid function:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;(ort_bot@blong)23&gt; file:close(pid(0, 8974, 7)).                              &lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)24&gt; file:close(pid(0, 8975, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)25&gt; file:close(pid(0, 8976, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)26&gt; file:close(pid(0, 8977, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)27&gt; file:close(pid(0, 8978, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)28&gt; file:close(pid(0, 8979, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)29&gt; file:close(pid(0, 8980, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)30&gt; file:close(pid(0, 8981, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)31&gt; file:close(pid(0, 8982, 7)).&lt;br /&gt;ok&lt;br /&gt;(ort_bot@blong)32&gt; file:close(pid(0, 8983, 7)).&lt;br /&gt;ok&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, call i() again and you'll notice all of those pesky file's have been closed.  You can also do all of this from a remote machine if you have run your erl properly.  For example my remote application is run on a machine called 'blong' and the node name is 'ort_bot'.  I am on 'ooter' on a machine called 'osx'.  So from 'osx' I can do this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;osx:~/projects/Erlang orbitz$ erl -sname ooter -setcookie cookiemonster&lt;br /&gt;Erlang (BEAM) emulator version 5.4.13 [source] [threads:0]&lt;br /&gt;&lt;br /&gt;Eshell V5.4.13  (abort with ^G)&lt;br /&gt;(ooter@osx)1&gt; &lt;br /&gt;User switch command&lt;br /&gt; --&gt; r ort_bot@blong&lt;br /&gt; --&gt; j&lt;br /&gt;   1  {shell,start,[init]}&lt;br /&gt;   2* {ort_bot@blong,shell,start,[]}&lt;br /&gt; --&gt; c 2&lt;br /&gt;Eshell V5.4.12  (abort with ^G)&lt;br /&gt;(ort_bot@blong)1&gt; i().&lt;br /&gt;Pid                   Initial Call                          Heap     Reds Msgs&lt;br /&gt;Registered            Current Function                     Stack              &lt;br /&gt;&lt;0.0.0&gt;               otp_ring0:start/2                      377     6579    0&lt;br /&gt;init                  init:loop/1                              2              &lt;br /&gt;&lt;0.2.0&gt;               erlang:apply/2                         610   161416    0&lt;br /&gt;erl_prim_loader       erl_prim_loader:loop/3                   5              &lt;br /&gt;&lt;0.4.0&gt;               gen_event:init_it/6                    610      557    0&lt;br /&gt;error_logger          gen_event:loop/4                        10              &lt;br /&gt;&lt;0.5.0&gt;               erlang:apply/2                        6765     8289    0&lt;br /&gt;application_controlle gen_server:loop/6                        7              &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Connecting to a remote shell is easy and we now have a shell on that node and can do anything from here we want (infact I've done halt(). quite a few times by accident not thinking oi!).&lt;br /&gt;&lt;br /&gt;Alternativly, you can also use pman, which provides an interface much like i() but does more interesting stuff too.  For instance you can see linked processes and kill various processe through pman.  In order to use pman, on your local node simply run: pman:start().&lt;br /&gt;This provide you with a window that looks like:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://ortdotlove.net/~orbitz/images/pman_01.png"/&gt;&lt;br /&gt;&lt;br /&gt;This looks just like i().  And from the 'node' menu you can switch nodes to view the processes on.  As you can see from this screenshot I am viewing the processes on ort_bot@blong, which is a remote node.&lt;br /&gt;&lt;br /&gt;As you can see, Erlang provides a very powerful set of tools to keep your application stable and perform various operations.  It is things like this that make me glad to run code in a shell rather than a stand alone appliction.  For situations like this, the power of the erlang shell is unparalleled.&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;Well in his infinite wisdom, after a bit of playing around petekaz came up with two functions that makes solving this particular problem all of the easier.  My goal was mainy to show how to interact with the shell to get useful information about processes, but petekaz has shown me how to actually close a specific file.  It seems file:open drops some useful information into ets.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[ file:close(P) || P &lt;- processes(), {ok, "/tmp/test.erl"} == file:pid2name(P) ].&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Where "/tmp/test.erl" is the file you are trying to close.&lt;br /&gt;This makes use of two useful functinos.  processes for starters evaluates to a list of all current proceses runninging in the node, and file:pid2name takes a pid and tells you what file it is associated with.  If the pid is not a file it returns undefined.&lt;br /&gt;So it seems Erlang has a complete solution to this problem.&lt;br /&gt;&lt;br /&gt;Thanks petekaz for figuring this one out completely.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114384501342651754?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114384501342651754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114384501342651754' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114384501342651754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114384501342651754'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/03/fun-with-processes-updated.html' title='Fun with processes (Updated)'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114317141176007087</id><published>2006-03-23T22:33:00.000-05:00</published><updated>2006-03-23T22:36:51.773-05:00</updated><title type='text'>Oort</title><content type='html'>Well it was pretty painful but I ripped out most of my terrible code and replaced it with pretty gen_server's and the likes.  The code is still in a state of flux and needs to be polished a bit more, but it's a good start.  You can gawk at it here:&lt;br /&gt;&lt;br /&gt;svn://ortdotlove.net/Erlang/trunk/p1&lt;br /&gt;&lt;br /&gt;Ignore the manderlbot source tree in there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114317141176007087?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114317141176007087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114317141176007087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114317141176007087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114317141176007087'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/03/oort.html' title='Oort'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-114166760643919373</id><published>2006-03-06T12:43:00.000-05:00</published><updated>2006-03-06T12:54:03.836-05:00</updated><title type='text'>MEUG</title><content type='html'>MEUG is Massachusetts Erlang User Group.&lt;br /&gt;For some reason, there seem to be a lot of Erlang users in MA.   I would like to get us all together semi-regularly.  We can enjoy some good food, some drinks, and talk about Erlang, or whatever else comes up. Concurrency in general is an interesting topic that that is much to talk about.&lt;br /&gt;I will keep people updated.  If there are any MA based Erlangers interested that I am not yet aware of feel free to email me at:&lt;br /&gt;orbitz AT ortdotlove.net  (That is really ortdotlove) or post a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-114166760643919373?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/114166760643919373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=114166760643919373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114166760643919373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/114166760643919373'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/03/meug.html' title='MEUG'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-113803793588305411</id><published>2006-01-23T12:04:00.000-05:00</published><updated>2006-01-23T12:40:57.080-05:00</updated><title type='text'>Re: Re: Re: Ruby Array class sucks</title><content type='html'>I have been meaning to respond to this &lt;a href="http://factor-language.blogspot.com/2005/12/approaching-functional-programming.html"&gt;post&lt;/a&gt; on the factor blog for awhile.  Factor has grown a lot, and this blog tracks the development of it.  Factor is the result of Forth and Lisp having babies.  But the post I'm interested in doesn't have so much to do with factor but with ruby.  It is in response to another post (URL at the factor site) about a complaint with Ruby's Array class.  The complaint centers mainly around the Array object having far more methods than it should and quite a few that don't belong there.  Slava's (factor creator) response suggests that the methods do deserve to be there and from a functional standpoint most of them make plenty of sense.&lt;br /&gt;&lt;br /&gt;For a number of the methods in Array, I do agree with slava that they should be present.  For instance, the authors complaint about Array.new being able to preset an array to a specific value is silly to me, I often want some sort of initial value to work from so I would imagine many other people are in my boat.&lt;br /&gt;&lt;br /&gt;Around Array.transpose, I start to disagree though.  transpose takes an Array and treats it like a matrix.  Slava's response is:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;It might surprise the author to learn that mathematically, a matrix &lt;i&gt;is&lt;/i&gt; a two-dimensional array. In Factor, you can perform mathematical operations on vectors, such as vector addition, dot product, and so on.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Ok, so basicaly the argument is, a matrix resembles an array in some way and factor allows these sort of manipulations, thus ruby should.  Well ok, let's say, yes, a matrix is a two-dimensional array, that's nice.  But what does that make an Array then?  An Array is also a two-dimensional array? That sounds a bit circular.  Why should a method in Array depend on Array being thought of as a specific type of object.  If we want to do matrix work, I suggest abstracting a matrix type, even if it's as simple as Matrix = Array.  But really, it sounds like transpose should be in some sort of Matrix object.&lt;br /&gt;&lt;br /&gt;Array.rassoc also seems a bit out of place to me.  Slava says:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Yes, and there's nothing wrong with that. Association lists, while they suffer from linear lookup time, are occasionally useful where you want to have a mapping together with a certain intrinsic order. For example, Factor's generic word code takes the hashtable of methods defined on a generic, converts this to an association list, then sorts the association list according to the partial ordering of classes. Finally, the sorted association list is used to generate code.&lt;/blockquote&gt;&lt;br /&gt;Again, the argument of "This is ok because factor does it" does not quite fly with me.  Now, when I write code and I'm not quite sure what data type I really want, but I need some sort of key-&gt;value association, I will often just use a list or array type to start out with, abstracted into some interface so when I decide what I finally need I can simply change the backend.  Now, is this a good reason to put a function that treats a list like a map inside a list object?  In my opinion, No.&lt;br /&gt;&lt;br /&gt;In my opinion, I would use some sort of generic sequence object that has various methods that act on arrays and lists and other sequence objects, allowing you to perform some of these manipulations.  In most languages, I would probably go as far to even make something like rassoc just be a plain function, no need to make it part of an object.  But I have a feeling a lot of Ruby programmers don't feel content unless they have methods in some class.&lt;br /&gt;&lt;br /&gt;This Array object seems to be similar to various classes in Python.  Back in the day, Python developers could add methods to classes without any sort of vote.  This is why the Python standard lib has lots of random modules that one would not normally think should be in a standard library, and also why Python has been making such an effort to clean up a lot of the standard classes and provide a more consistent interface to them.&lt;br /&gt;&lt;br /&gt;Sorry this post does not actually contain anything on erlang.  My next one will, I promise.  Feel free to flame me in response to my Ruby thoughts, just be civil.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-113803793588305411?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/113803793588305411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=113803793588305411' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113803793588305411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113803793588305411'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2006/01/re-re-re-ruby-array-class-sucks.html' title='Re: Re: Re: Ruby Array class sucks'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-113263275184227612</id><published>2005-11-21T23:11:00.000-05:00</published><updated>2005-11-21T23:12:31.853-05:00</updated><title type='text'>Port Drivers</title><content type='html'>Does anyone have any good tutorials on writing ports?  Google doesn't seem to return much on initial tries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-113263275184227612?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/113263275184227612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=113263275184227612' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113263275184227612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113263275184227612'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/11/port-drivers.html' title='Port Drivers'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-113228579883621875</id><published>2005-11-17T22:43:00.000-05:00</published><updated>2005-11-17T22:49:58.846-05:00</updated><title type='text'>Single exit point</title><content type='html'>Many programmers insist on only having the flow of control in their function end at a single point.  I got wondering for a few minutes if any languages enforce this style of programming.  Then I realized.  Erlang has no 'return' operator, so doesn't Erlang enforce this?  That sounds about right as far as I can see.  So an Erlang function can only have 1 exit point.  That should make them feel good.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But as was just pointed out to me in the middle of writing this, Erlang has 'throw'.  There can be many of thoughs.  So perhaps Erlang doesn't have 1 exit point.&lt;br /&gt;&lt;br /&gt;On a final note:&lt;br /&gt;Does having 1 exit point even matter? Who cares?  The beauty of Erlang (in my opinion) is it almost forces you to write short concise functions.  Every single one of my erlang functions fits on 1 screen easily, so does having multiple exit locations from there matter? In my opinion, no.  I don't need to go searching through pages of code for that function to find it, I can see it, so who cares?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-113228579883621875?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/113228579883621875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=113228579883621875' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113228579883621875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/113228579883621875'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/11/single-exit-point.html' title='Single exit point'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112735687252241562</id><published>2005-09-21T19:39:00.000-04:00</published><updated>2005-09-21T22:41:12.560-04:00</updated><title type='text'>The Twisted Matrix</title><content type='html'>It has been a long road from where I started to using Erlang.  I certainly don't plan on stopping with Erlang but so far I am quite the fan of it.  On this road, which finally lead me here, I have used C, C++, Java, and Python, to name a few.  I still have code for a multithreaded http I was writing in C hanging around.&lt;br /&gt;I still use Python quite a bit, and one of the best tools in Python I have used is the &lt;a href="http://www.twistedmatrix.com/"&gt;Twisted Matrix&lt;/a&gt; framework.  Prior to discovering Erlang (well more of introduced to it by noss, which i am deeply in debt for), I felt that Python was really *the* language for socket programming.  Twisted is what made me think this.&lt;br /&gt;Now, just to be clear, Erlang certainly does not make Python obsolete.  Don't confuse enthusiasm for Erlang with feeling every other language is useless.  I introduced Python and Twisted into our development cycle at work and I am fairly pleased with the results.&lt;br /&gt;For those that don't know what Twisted is, it is a framework for developing software.  What makes Twisted special is they have put a lot of work into making everything work in one thread.  Making a server or client that handles multiple network connections is fairly trivial in Twisted.&lt;br /&gt;So what makes Twisted work how it does? A uniform eventloop.  In their case it's called a reactor.  There are a bunch of different kinds of reactors in Twisted.   One needs to be made for whichever kind of event loop you are using.  There is a select reactor (default), gtkreactor, gtk2reactor, wxwidgets reactor, and some sort of win32 reactor (I think still under development).  The good thing is, most of your code can generally be written without caring about what reactor is being used.  That is, atleast, the portions that don't depend on gtk or win32 or wx.&lt;br /&gt;Five years ago, when the Twisted project was first created, the authors feel that Python was the best language for the job.  My question is, if Twisted was started today, would Python still be the best choice.  I address part of the problem in a previous &lt;a href="http://orbitz-erlang.blogspot.com/2005/08/where-concurrency-shines.html"&gt;post&lt;/a&gt;. Part of the problem that I point out is, you have to do a lot of work to force everything into the event loop.  That makes code reuse more difficult, and near impossible if you need to use a proprietary library that you can't make non-blocking.&lt;br /&gt;An obvious example of this is the adbapi module.  adbapi module can use any DB-API 2.0 compliant module.  This is to make adbapi useful.  There are quite a few DB-API 2.0 compliant modules for Python so the best thing is to make use of them.  adbapi's API is not asynchronous or non-blocking though.  Doing queries in the Twisted reactor thread means the entire application will stall until the query is finished.  To solve this, Twisted does the queries in a thread.  Twisted has to fall-back on the very thing it is trying to avoid in order to work.  Python is particularly bad at threading too so Twisted tries to keep the number of threads to a reasonable amount.  This means the number of queries you can have going concurrently is dependent on this.&lt;br /&gt;A native implementation of the postgresql protocol has been implemented.  It is called &lt;a href="http://www.jamwt.com/pgasync/"&gt;pgasync&lt;/a&gt;.  I beleive the author has commented on how much quicker a large number of queries runs in his implementation, although I cannot find the quote.  But has the same problem I pointed out before.  Because Twisted is all in one thread, everything has to conform to its event loop making the implementation of the pgsql protocol useless.  It had to be rewritten to work well in Twisted.  This implementation is also fairly useless anywhere except Twisted.  I cannot use this in an application that uses an event loop other than Twisted.  Wouldn't it be nice if I could use code between projects that arn't dependent on Twisted?  In a COL this is a non-issue.  Simply run the database code in a process.  Processes are part of the language so they are part of any program.&lt;br /&gt;So, to get back to my question, would Python still be the choice of Twisted today, I don't know.  I asked the people of Twisted if they still would.  For the most part, it seems like they didn't quite know Erlang well enough to say if they would choose it.  A few developers said one of the main reasons they chose Python was for its large standard library.  In particular the 'os' module was pointed out as an important module that makes Python a good choice.  However, after some research, most of the 'os' module is in Erlang's standard library as well.  In my opinion, I think the quality of the Erlang standard library and OTP is quite a bit better than Pythons.  Python's standard library seems to have suffered from a time period where anyone put anything they wanted into it.  As a result, it is large, but a number of modules are fairly poor in quality.&lt;br /&gt;Even if Python has a number of modules in its standard library that are nice for building Twisted, they still need to do a lot of work to force all of this code into the Twisted event loop.  If you choose a COL, then you don't have to do any work in forcing code into a single event loop.  Instead, you have to do work to build the standard library that Python has.  Is that a lot of work? Yes.&lt;br /&gt;One could also argue, "There are a lot more Python projects than Erlang ones so there is a lot of code being written for Python that Twisted can make use of".  I think there is little contest in the point that there are more Python projects and programmers.  But can Twisted really make use of this code?  I think, in general, no, not without work.  A lot of interesting things are probably going to involve some blocking somewhere which either needs to be pushed to a thread or rewritten not to block, such as the example I have already given.&lt;br /&gt;The choice to use Python is a difficult one, I think.  In my opinion, Python really does not offer much that Erlang doesn't.  I think, considering the services Twisted is trying to offer, a COL would be an excellent choice for it.  Twisted does a lot of work trying to make asynchronous programming less confusing but writing concurrent programs is more natural.  It feels more natural atleast.&lt;br /&gt;I have had a lot of success using Twisted.  I don't think I'd write a socket program in Python without it.  I also think I would generally not write a socket program in Python these days.  Twisted and Erlang seem to be trying to accomplish much the same thing, although going about things in very different ways.  In the end I think something like Erlang will win out.  A COL seems to be saying, the world is concurrent so lets try to let people write in this natural way.  Whereas, Twisted is forcing people to write in a rather artifical and unnatural way.  Asynchronous programming works once you grasp it but even still the flow of the programs is rather awkward and hard to grasp I think.&lt;br /&gt;I feel that, today, something like Twisted would be better off written in a COL.  Let the work go into making powerful tools instead of massaging prewritten code into the event loop.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112735687252241562?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112735687252241562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112735687252241562' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112735687252241562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112735687252241562'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/09/twisted-matrix.html' title='The Twisted Matrix'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112726055669395867</id><published>2005-09-20T18:52:00.000-04:00</published><updated>2005-09-20T19:56:47.210-04:00</updated><title type='text'>Java And Threads (Jetty)</title><content type='html'>noss in #erlang on freenode recently brought to my attention: &lt;a href="http://www.mortbay.com/MB/log/gregw/?permalink=Jetty6Continuations.html"&gt;Jetty Continuations&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is an interesting blog entry. The basic idea is, instead of using 1 thread per connection, since connections can last awhile, they use 1 thread per request that a connection has. The hope being, a connection will idle most of the time and only send requests once in awhile. The problem that they ran into is, a piece of software is using a request timeout to poll for data. So requests are now sticking around for a long time, so they have all these active threads that they don't want. So to deal with this, they use a concept of continuations so the thread can die but the request still hang around, and then once it's ready to be processed a thread is created again and the request is handled. So having all these requests hanging around that arn't doing anything is no longer a problem.&lt;br /&gt;Well, this begs the question, why are you using a dynamic number of threads in the first place if you are going to have to limit how many you can even make. If the problem, in the first place, is they have too many threads running, then their solution works only for idle threads doesn't it? Being forced to push some of the requests to a continuation means they have applied some artificial limit to the number of threads which can be run. What happens then, when the number of valid active requests exceeds this limit? What then? Push active requests to a continuation and get to then when you have time? Simply don't let the new requests get handled? If they want to to use threads to solve their problem then putting a limit on them seems to make the choice of threads not a good one. Too poorly paraphrase Joe Armstrong, are they also going to put a limit on the number of objects they can use? If threads are integral to solving your problem, then it seems as though you are limiting how well you can solve the problem.&lt;br /&gt;&lt;br /&gt;This also got me thinking about other issues involving threading in non-concurrent orientated languages. Using a COL (Concurrent Orientated Language) all the time would be nice (and I hope that is what the future holds for us). But today, I don't think it is always practical. We can't use Erlang or Mozart or Concurrent ML for every problem due to various limiting factors. But on the same token, using threads in a non-COL sometimes makes the solution to a problem a bit easier to work with. At the very least, making use of multiple processors sounds like a decent argument. But writing code in, say, java, as if it was Erlang does not work out. I think the best one can hope to do is a static number of threads. Spawning and destroying threads dynamically in a non-COL can be fairly expensive in the long run and you have to avoid situations where you start up too many threads. I think having a static number of threads i a pool or with each doing a specific task is somewhat the "best of both worlds". You get your concurrency and you, hopefully, avoid situations like Jetty is running into. As far as communication between the threads is concerned, I think message passing is the best one can hope for. The main reason I think one should use message passing in these non-COL's is, it forces all of the synchornization to happen in one localized place. You can, hopefully, avoid deadlocks this way. And if there is an error in your synchornization, you can fix it in one spot and it is fixed everywhere. As opposed to having things synchornized all over the code, god knows where you may have made an error.&lt;br /&gt;&lt;br /&gt;I think this post most likely opened up a can of worms. I lightly touched on a lot of issues and most likely did not explain things in full. Perhaps this will raise some interesting questions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112726055669395867?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112726055669395867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112726055669395867' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112726055669395867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112726055669395867'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/09/java-and-threads-jetty.html' title='Java And Threads (Jetty)'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112648152879565115</id><published>2005-09-11T19:08:00.000-04:00</published><updated>2005-09-11T19:33:17.643-04:00</updated><title type='text'>Initial impressions of yaws</title><content type='html'>If any of this post is incorrect, please feel free to post a comment and correct me.&lt;br /&gt;&lt;br /&gt;I have recently installed yaws and I am looking at it to create a small website. It will be fairly simple. My previous web experience has been using &lt;a href="http://www.divmod.org/projects/nevow"&gt;Nevow&lt;/a&gt; with Twisted. Nevow allows you to create xml files and then the template engine extracts information from the xml file which is translated to function calls on an object representing the page. I like this solution. It keeps the code seperate from presentation which many people seem to suggest is a good idea. I see it as a positive purely based on working with webdesigners. I dislike doing web frontends so allowing someone to make that and giving them the bare minimum needed to let them call functions in my code seems rather nice. From my experiences with yaws, it seems to use a style that reminds me more of PHP. The major difference being that you can use Erlang terms to be transformed to HTML. Nevow has something similar to this called stan. Even with this though, the .yaws file is still not purely Erlang code, but requires escaping html with a &lt;erl&gt; tag.  This style of making web applications seems fairly error prone and difficult to work with in a team.&lt;br /&gt;I do think Erlang would make a fairly good web development language. The applications could easily be distributed over several nodes, not requiring one to use some sort of load balancer. A web app could scale quite well. But what can be done about the interface for programming? Some sort of XML system might work but I'm not convinced of that. There must be some more intuitive means of mixing code and presentation. I wouldn't be sirprised if someone has attempted to tackle this already, maybe something exists on google about it.&lt;/erl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112648152879565115?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112648152879565115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112648152879565115' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112648152879565115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112648152879565115'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/09/initial-impressions-of-yaws.html' title='Initial impressions of yaws'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112614075072031425</id><published>2005-09-07T20:40:00.000-04:00</published><updated>2005-09-07T20:52:30.726-04:00</updated><title type='text'>Parallel Project</title><content type='html'>I have a study in Parallel Programming this semester.  However, the teacher is fairly lenient as far as projects are concerned.  I am looking for some interesting project relating to Erlang.  The leading idea right now is to create some sort of distributed computing framework.  The idea would be using Erlang to communicate between nodes and then have each node communicate with a local process which does the actual computing (assuming Erlang could not handle the calculations).  The major implementation would be a BLAST algorithm since that seems fairly easy to distribute and could possibly have some use at my college.  Other ideas include some sort of fault tolerence framework or application which handles nodes going down well.  That would seem fairly easy in Erlang so that probably would not provide a semester worth of interesting work.  Another possibility is a peer-to-peer chat application where each user contributes to the number of possible people to host.&lt;br /&gt;Hrmm, hopefully I'll get a better idea soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112614075072031425?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112614075072031425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112614075072031425' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112614075072031425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112614075072031425'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/09/parallel-project.html' title='Parallel Project'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112596584470864140</id><published>2005-09-05T20:13:00.000-04:00</published><updated>2005-09-05T20:19:28.806-04:00</updated><title type='text'>Bookmarks</title><content type='html'>My archive of bookmarks is slowly growing. It contains a Erlang section, a long with a number of other languages as well as lots of other URL's.&lt;br /&gt;&lt;a href="http://ortdotlove.net/bookmarks.html"&gt;&lt;br /&gt;http://ortdotlove.net/bookmarks.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112596584470864140?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112596584470864140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112596584470864140' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112596584470864140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112596584470864140'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/09/bookmarks.html' title='Bookmarks'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112456805309588694</id><published>2005-08-20T15:30:00.000-04:00</published><updated>2005-08-20T16:00:53.103-04:00</updated><title type='text'>Where concurrency shines</title><content type='html'>I think that it can almost be stated as a fact that concurrency in languages that weren't designed with concurrency in mind  tends to be poor.  The languages I have in mind here are Python, C, C++ and similar.  I have come across a few people who disagree with this statement however after questioning I have found that they have A) Not done much of anything complex with threads B) Never used a concurrently oriented language.  Needless to say, I don't take their opinion very seriously.  Now, obviously, you can take the time to write an application that uses threads and works well.  But, with enough time, you can do just about anything, and in the time it takes to make that application one can deffinatly develope an equivalent program faster in concurrent orientated (CO) language.&lt;br /&gt;Because writting decent threaded applications in other languages is so difficult there are a number of frameworks available that try to make it easier to write applications in a single thread.  One of the reasons I think these frameworks will fail in comparison to a language such as Erlang for most developers is the amount of work it takes to integrate other libraries into it.  For anyone that has used a framework such as Twisted, they have probably run into a situation where they have a third party library they want to use however the problem is, it blocks.  For an asynchornous framework this is murder.  So one has two choices.  Either to run the third party library in its own thread.  Obviously this is generally not what we want to do since the whole point of using the framework is to avoid threads.  The other solution is to rewrite the library to integrate it into the frameworks event loop.  Depending on the situation, this might be acceptable but it sure is a pain to have to do extra work to use this library.  Now, a language which supports concurrency does not have this problem so much.  The first solution, of running the library in a thread, works perfectly fine.  You probably have 300 or 400 threads going already so it is no big deal.  This makes it easy to distribute libraries for the particular language.&lt;br /&gt;For a simple example.  Imagine you make a really great http client in python.  You can't really make a general http client because you need to take into account the various networking frameworks they might be using.  If they are using twisted then it needs to integrate into the twisted event loop to be really useful.  If they are using asyncore it needs to integrate into the asyncore event loop, and so on and so forth.  Now take the same situation in erlang.  Just throw the client in a process and you are all set.  You don't have to rewrite anything.  The obvious benefit of this is increased development speed.&lt;br /&gt;&lt;br /&gt;I think it seems pretty clear that our processors and applications are moving towards more concurrent environments.  Languages that can take advantage of this environment are most likely going to be the ones that make it.  However I'm no fortune teller, so there is a good chance I could be wrong.&lt;br /&gt;&lt;br /&gt;I think I tried to put too much into this one post so it might not make sense.  Hopefully I got my ideas across.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112456805309588694?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112456805309588694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112456805309588694' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112456805309588694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112456805309588694'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/where-concurrency-shines.html' title='Where concurrency shines'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112447890264133411</id><published>2005-08-19T14:46:00.000-04:00</published><updated>2005-08-19T15:15:02.650-04:00</updated><title type='text'>Developing on the go</title><content type='html'>One benefit to using erlang compared to more traditional languages is the development cycle.  Generally you write code, compile, debug, write, compile, debug, until you have something you want to use.  In between compile and debug you run the program.  In traditional languages you shut down the application then restart it to debug again.  In erlang we can skip the 'restart' and simply load the new code in.  This is assuming no bugs in the code didn't cause the entire application to crash horribly.&lt;br /&gt;So basically, what is going on is, if you have a logic problem or what not in your application that you wish to fix.  Outside of your running application, you edit the appropriate .erl files and recompile.  For example, your application consists of a.erl and b.erl.  In b.erl you have a function called mogwai.&lt;br /&gt;So in our example.  a.erl calls b:mogwai, and b:mogwai has some sort of error in it that does not cause the application to crash but you want to fix, regardless.  You fix b:mogwai's error and you want to load the new codebase in your running application.  Recompile b.erl then in the shell to your application you simple do:&lt;br /&gt;&lt;br /&gt;nl(b).&lt;br /&gt;&lt;br /&gt;This loads the new version of b into your application and now calls to b:mogwai will use the current version of the function.  For certain applications this certinaly provides a more elegant development cycle.  I think this style also alters the structure of ones code.  For instance, if one writes an application knowing that errors in the code can be fixed on the fly, no longer do they necesarly have to exit nicely.  Rather, the application can provide a means of restarting the portions that have crashed.  The application can continue working without the crashed process/code or stall until the required portion can be brought back.  I'm under the impression this is a feature supervision trees offer you.  A supervisor simply restarts a process if it crashes, and reports it.  By restarting, a new codebase can be loaded that fixes the error.&lt;br /&gt;&lt;br /&gt;One final note on how code replacement works.  Erlang only attempts to load a new module if the call is in the form of: module:function.  For instance, if you have a process in a loop something like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;loop() -&gt;&lt;br /&gt;  receive&lt;br /&gt;     Something -&gt;&lt;br /&gt;         loop()&lt;br /&gt;   end.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you reload the module that this loop is defined in, the call the 'loop()' will not load the new codebase.  The common idiom is something a long the lines of:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;loop() -&gt;&lt;br /&gt;  receive&lt;br /&gt;    restart -&gt;&lt;br /&gt;      ?MODULE:loop();&lt;br /&gt;    Something -&gt;&lt;br /&gt;       loop()&lt;br /&gt;  end.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This will load the new codebase.  On a final note, any function called as module:function must be exported.&lt;br /&gt;Erlang certinaly provides some interesting features.  Certinaly somethign like code replacement is possible in other languages, such as python (which provides a reload function to reload a module) I think erlang provides a more elegant solution.  For instance I don't think Python provides a means of a module to reload itself, especially in the middle of an event loop.&lt;br /&gt;However this is not a contest between code replacement in various languages.  I have modified my irc bot to allow code replacement more seemlessly, however I have not allowed a decent means of bringing an irc bot back if there is an error which causes a crash.  I'll have the new code online later if anyone is interested.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112447890264133411?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112447890264133411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112447890264133411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112447890264133411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112447890264133411'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/developing-on-go.html' title='Developing on the go'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112424993043873393</id><published>2005-08-16T23:10:00.000-04:00</published><updated>2005-08-17T16:59:47.323-04:00</updated><title type='text'>Erlang and strings</title><content type='html'>A lot of people complain about strings in erlang. I am one of them. Right now I am under the impression a string type needs to be added to erlang. Joe Armstrong thinks that instead of a string we simply need a character type. My complaint with that is there is no decent container for the character type. In erlangs we have tuples, binaries, and lists. Tuples are meant to store a fixed number of objects and do not have operations on them to perform operations such as iterate through them. The element/2 function allows you to access an index of a tuple but that isnt' very useful for iterating through. Binaries might be nice, but there are no functions to nicely deal with binaries as strings. Lists are what we currently have and I am not pleased. Using a linked list to store a string certinaly seems unreasonable in any other language. You have to store a character value and a link to the next node. This is a lot of memory for a string. The other problem with these containers is none of them allow O(1) access to indecies as far as I know. Am I wrong here? I suppose the question then is, is that a problem? I am under the impression that one generally wants O(1) access. For instance, if you have an index in the string and need to access it and surrounding indecies repeatedly.&lt;br /&gt;&lt;br /&gt;http://schemecookbook.org/view/Erlang/StringBasics has a quote supposedly from the sendmail people:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;But Erlang's treatment of strings as lists of bytes is as elegant as it is impractical. The factor-of-eight storage expansion of text, as well as the copying that occurs during message-passing, cripples Erlang for all but the most performance-insensitive text-processing applications.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;This is in reference to their load balancing software. Is this true? I am inclined to think that it certinaly uses a lot of memory used up, but most text-processing is going to require touching every character in a string anyways won't it? What exactly is performance intensive text-processing? Does anyone have any ideas? If one is going to be iterating through the string they can use a binary to store the byte values. The problem with this is that none of the string functions work on binaries. I'm under the impression a string container type will solve some problems. Using integers as the character values seems like a fine idea to me, as people like to point out it makes dealing with unicode slightly easier.&lt;br /&gt;&lt;br /&gt;What problems would having a character type solve?  Maybe in the morning I'll be able to think of something.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112424993043873393?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112424993043873393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112424993043873393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112424993043873393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112424993043873393'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/erlang-and-strings.html' title='Erlang and strings'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112424028994665742</id><published>2005-08-16T20:55:00.000-04:00</published><updated>2005-08-16T20:58:09.950-04:00</updated><title type='text'>Identd as done as I care</title><content type='html'>The identd is as done as I'm interested in right now.  It works atleast.  Instead of worrying about how to figure out who belongs to an actual port I just return a random ident value for any input.  However, the function it uses to make this is a variable you pass to the server so it is not very difficult to give it a different function. To run it, simply compile all the files then do&lt;br /&gt;identd:start(SomePort, {random_identd, random}).&lt;br /&gt;&lt;br /&gt;There is no clean shutdown, just kill your shell.&lt;br /&gt;&lt;br /&gt;You can download it &lt;a href="http://ortdotlove.net/%7Eorbitz/temp/p2.tar.gz"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112424028994665742?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112424028994665742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112424028994665742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112424028994665742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112424028994665742'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/identd-as-done-as-i-care.html' title='Identd as done as I care'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112416377807273163</id><published>2005-08-15T23:34:00.000-04:00</published><updated>2005-08-15T23:42:58.076-04:00</updated><title type='text'>Identd</title><content type='html'>I think the basic design for my identd is going to be:&lt;br /&gt;&lt;ol&gt;   &lt;li&gt;Start a process which takes a port and a function.&lt;/li&gt;   &lt;li&gt;On a new connection, start a process to handle the connection with the function given.&lt;br /&gt;  &lt;/li&gt;   &lt;li&gt;Go back to waiting.&lt;/li&gt;   &lt;li&gt;The new process will read in the port numbers, parse them out, then call the function given with the port information&lt;br /&gt;  &lt;/li&gt;   &lt;li&gt;The function does what it needs to and returns the information&lt;/li&gt;   &lt;li&gt;The process responds on the socket with the correct information.&lt;/li&gt; &lt;/ol&gt; I think this would work good with gen_server behavior, unforunatly I don't quite understand superivsion tree's that well.  I will write it the ad-hoc way first then once I figure out the correct method rewrite it that way.&lt;br /&gt;This framework shouldn't be too hard, making a correct identd function which actually gets the  user from the ports might be.  Basic one will just return a random identd.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112416377807273163?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112416377807273163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112416377807273163' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112416377807273163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112416377807273163'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/identd.html' title='Identd'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112416025682290524</id><published>2005-08-15T22:38:00.000-04:00</published><updated>2005-08-15T22:44:16.826-04:00</updated><title type='text'>IRC Bot</title><content type='html'>Here is the code for the latest revision of my IRC Bot.  It isn't made to be use friendly right now so don't expect it to work right off the bat.&lt;br /&gt;&lt;br /&gt;I think to get it started you'll need to do the following:&lt;br /&gt;&lt;ol&gt;   &lt;li&gt;Compile everything, be sure to add the inc directory to your include path.&lt;/li&gt;   &lt;li&gt;Start it with a node name and set a mnesia directory.&lt;/li&gt;   &lt;li&gt;Call p1_db:start().  Then p1_db:create_tables().&lt;/li&gt;   &lt;li&gt;Then call irc_bot:add_bot (Maybe it's addbot?). It takes a tuple, see code to figure it out.&lt;/li&gt;   &lt;li&gt;p1_main:start()&lt;/li&gt;   &lt;li&gt;When you are finished: bot_server ! stop.  The beauty of erlang lets you do this from another node on another machine too, if you so desire.&lt;/li&gt; &lt;/ol&gt; The code can be found &lt;a href="http://ortdotlove.net/%7Eorbitz/temp/p1.tar.gz"&gt;here.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The only other erlang irc bot I've found is manderlbot which can be found on freshmeat.  I think it is a bit better designed than mine and has the intention of other people using it in mind where as mine is more of me just playing around.  If there is an interest in it perhaps I will do more with it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112416025682290524?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112416025682290524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112416025682290524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112416025682290524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112416025682290524'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/irc-bot.html' title='IRC Bot'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15461779.post-112415851835696322</id><published>2005-08-15T22:09:00.000-04:00</published><updated>2005-08-15T22:15:18.360-04:00</updated><title type='text'>Initial Post</title><content type='html'>I will be posting my various erlang accomplishments here.  My intended goal is to write a smtpd in Erlang.  I will have various posts on that in the future.  So far I would not describe myself as a very good programmer but I am working on that.  I have written portions of an erlang irc bot.  It does not do very much, although it has the ability to relay chats between channels on multiple networks and supports some concept of factoids.  My next mini project is a plugable identd.  This will be fairly small and simply provide the ability to give it a function that creates a response.&lt;br /&gt;Feel free to post responses to my post, I don't mind constructive criticism.  The hope is to make my projects better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15461779-112415851835696322?l=orbitz-erlang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://orbitz-erlang.blogspot.com/feeds/112415851835696322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15461779&amp;postID=112415851835696322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112415851835696322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15461779/posts/default/112415851835696322'/><link rel='alternate' type='text/html' href='http://orbitz-erlang.blogspot.com/2005/08/initial-post.html' title='Initial Post'/><author><name>orbitz</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
