<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>f i c i a l</title>
	<atom:link href="http://ficial.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ficial.wordpress.com</link>
	<description>Academia and Technology and Environment and Games and</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:13:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ficial.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>f i c i a l</title>
		<link>http://ficial.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ficial.wordpress.com/osd.xml" title="f i c i a l" />
	<atom:link rel='hub' href='http://ficial.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Introduction to Web Development &#8211; The Extended Web Stack</title>
		<link>http://ficial.wordpress.com/2011/12/05/introduction-to-web-development-the-extended-web-stack/</link>
		<comments>http://ficial.wordpress.com/2011/12/05/introduction-to-web-development-the-extended-web-stack/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 22:02:41 +0000</pubDate>
		<dc:creator>ficial</dc:creator>
				<category><![CDATA[brain dump]]></category>
		<category><![CDATA[techy]]></category>

		<guid isPermaLink="false">http://ficial.wordpress.com/?p=229</guid>
		<description><![CDATA[Web development (http://en.wikipedia.org/wiki/Web_development) is often framed in terms of layers, levels, or a stack. This arises from the abstract and technical way the application is sliced. The top-most layer is one closest to the end user &#8211; the person who is actually using the application to solve some particular problem or fulfill some particular need. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=229&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Web development (http://en.wikipedia.org/wiki/Web_development) is often framed in terms of layers, levels, or a stack. This arises from the abstract and technical way the application is sliced. The top-most layer is one closest to the end user &#8211; the person who is actually using the application to solve some particular problem or fulfill some particular need. The bottom layer is the one conceptually, and usually physically, is farthest from the end user &#8211; the operating system of the computer on which the application lives. The full stack is, from the bottom up, the operating system, the database engine, the database schema, the web server software, the server-side programming language, the application framework (optional), the server-side business logic, the client-side programming language, the presentation/UI language, the user experience/design, and the client-side business logic. Each layer depends on the ones below it and supports the ones above it. The overall application idea spans the whole stack. Web developers tend to specialize in a few closely related layers, but benefit greatly from a working knowledge of the whole stack. Web developers also need to understand more general programming concepts such as client-server architecture, object oriented programming, documentation, code style, debugging, event-driven systems, logic, and algorithms. Learning and using a source control system is also very important &#8211; git (http://en.wikipedia.org/wiki/Git_(software)) is a good one these days.</p>
<p>A web application starts with an over-arching idea &#8211; a problem to be solved or a service to be provided or some such thing. This informs work at all layers. It is totally independent of the specific technology used, to the point where it might even be implemented entirely without a computer. Before any of the detailed work begins one must have a thorough understanding the the application idea. I&#8217;ll go through rest of the layers from top to bottom, but that is NOT necessarily the order in which they&#8217;re implemented &#8211; the software development process is related to but separate from the software organization.</p>
<p>At the very top is the client-side business logic layer. This is the most important layer because it defines what the end user is actually allowed to do and how. This layer often has no direct technical representation. When it does, it appears in various forms of automated test tools/routines. The conceptual tools for this level are use cases (http://en.wikipedia.org/wiki/Use_case), user stories (http://en.wikipedia.org/wiki/User_story), and state and flow diagrams (http://en.wikipedia.org/wiki/State_diagram). The implementation work is usually done in a word processing program. Complicated systems may require / use UML (http://en.wikipedia.org/wiki/Unified_Modeling_Language). There aren&#8217;t very many automated test tools for client side business logic, so if you end up dealing with one you&#8217;ll almost certainly have to learn something specific to that project. Key skills at this layer are analyzing, hypothesizing, organizing, documenting, and proficiency and any technical tools that are used. The finished product of work at this layer is a clear, concise, and formal understanding of what the user is and isn&#8217;t allowed to do (and ideally at least a reference to why).</p>
<p>Next is the user interface/experience(UI/UX)/design layer (http://en.wikipedia.org/wiki/User_interface, http://en.wikipedia.org/wiki/User_experience). This is the most important layer because it determines whether your application will actually be used by and useful for the end user &#8211; the difference between a failed project and a successful one is not in the idea but in whether or not people want to use it. Conceptual work at this layer is done using tools like card sorts (http://en.wikipedia.org/wiki/Card_sorting, http://www.measuringux.com/CardSorting/, user surveys, flow diagrams (http://en.wikipedia.org/wiki/Control_flow_diagram), concept maps (http://en.wikipedia.org/wiki/Concept_map), and lots of rough sketches (usually in pen or pencil on paper). The goal of the conceptual work is to figure out how to present the underlying business logic in a way that is intuitive and appealing. The implementation work here is usually done in a graphics design program &#8211; adobe photoshop, adobe illustrator, or the open source package GIMP are all good options. There are also some good programs available for doing the rougher, faster work &#8211; http://mockflow.com/ is a good one. Key skills at this layer are user psychology, graphic design, visualization, artistit creation/vision, and technical skills with whatever graphics packages/applications are used. The finished product of work at this layer is usually design mockups (images show what components of the applications look like) and wireframes (low/no graphic representations of how a person uses and navigates the application).</p>
<p>Next is the presentation/UI language. This is the most important layer because it allows a user to actually interact with the application. In the wider programming world there are many tools used for this layer, but in the web world it&#8217;s much more limited (by the fact that there is a web browser running all this). HTML, CSS, and Javascript are the fundamental pieces of this layer. Two absolutely key concepts that bind those three together are the document object model (DOM &#8211; http://en.wikipedia.org/wiki/Document_Object_Model) and event handling (http://en.wikipedia.org/wiki/Event_handling). At this level Javascript is usually as a part of some sort of framework such as jQuery (http://en.wikipedia.org/wiki/Jquery, http://jquery.com/). HTML and CSS serve double roles here. In the first role, they mark up text and other data and tell the browser how to display it. In the second role they provide handles which the Javascript uses to manipulate things. Conceptual tools of this layer include event diagrams, flow diagrams, and general programming tools (e.g. iterative refinement, stubbing, problem abstraction, refactoring, etc.) Implementation tools of this level are a web browser (or browsers, for testing across multiple platforms), and some kind of programming environment. The latter may be a simple text editor or a full-blown IDE or anything in between. Key skills at this layer are program/code design, logic, visualization, documentation and technical skills with HTML, CSS, Javascript, and whatever Javascript framework is used. The finished product of work at this layer is something a user can interact with in a browser.</p>
<p>Next is the client side programming language. This is the most important layer because with out it the client side does nothing. This is tightly entwined with the presentation/UI language. In web development this is pretty much always going to be Javascript (http://en.wikipedia.org/wiki/JavaScript, http://www.w3schools.com/js/). The distinction between this level and the previous one is that this is more general whereas the previous one is specifically about presentation and interface management. In many ways the framework used above hides the richness and complexity of the client-side language as a whole. This level divorces the data manipulation from the user interaction &#8211; at this layer one is only concerned with code and data. Key skills for this layer are all the general programming techniques, and the specifics of the Javascript language. The finished product of this layer is a set of files containing Javascript code and documentation.</p>
<p>Next is the server side business logic. This is the most important layer because it defines what your application does; it provides the why&#8217;s for everything that your application does. The tools used for this layer are the same as for the client-side business logic layer. The focus at this layer tends to be less on users and more on data and events (though the data and events often originate from users). At this layer one has to define both support for user operations/actions and non-user-dependent, system-wide logic. The conceptual boundary between the client-side and server-side business logic is fuzzy, though in the end it is implemented in one place or the other. Security and privacy considerations (http://www.taoti.com/blog_web_security.php, http://code.google.com/edu/security/index.html, http://en.wikipedia.org/wiki/Web_development#Security_Considerations) will usually be major factors in deciding where a piece of logic finally resides. Key skills at this layer are analyzing, hypothesizing, organizing, documenting, and proficiency and any technical tools that are used. The finished product of work at this layer is a clear, concise, and formal understanding of what the application does.</p>
<p>Next is the application framework. This layer is optional &#8211; some applications depend heavily on it, and others eschew it entirely. The role of a framework is something of a matter of opinion and style &#8211; different developers will give wildly varying answers as to which framework should be used to what degree for any given application. An application framework is a set of tools and template code in a given organization model which together assist in the the creation of a web application. There are specialized frameworks (such as WordPress (http://wordpress.org/) or Drupal (http://drupal.org/) for content management, or MediaWiki (http://www.mediawiki.org/wiki/MediaWiki) or Twiki (http://twiki.org/) for wikis) and general frameworks (e.g. Rails (http://rubyonrails.org/), Zend (http://framework.zend.com/), Cake (http://cakephp.org/), Symfony (http://www.symfony-project.org/), and JSP (http://www.oracle.com/technetwork/java/javaee/jsp/index.html)). The conceptual tools vary from one framework to the next. If you want or have to use a given framework start by reading its high level documentation &#8211; you should get an understanding of the general approach that the framework uses and the high-level what it organizes and implements an application. The implementation tools are the language(s) in which the framework is written, the API/library code the framework provides, and the development tools the framework provides.</p>
<p>Next is the server side programming language. This is the most important layer because it makes everything on the server actually work. If an application framework used it will define also which language is used. Server side programming languages for web development are general, powerful programming languages that usually are especially adept at string manipulation and handling abstract data objects. Often they are &#8216;scripting languages&#8217;, which connotes looser style and faster development, but server-side code could certainly be written in a more formal, structured language. Some common server-side web programming languages are PHP (http://php.net/manual/en/index.php), Python (http://python.org/), Ruby (http://www.ruby-lang.org/en/), Perl (http://www.perl.org/), and Java (http://en.wikipedia.org/wiki/Java_(programming_language)). The conceptual tools at this layer are all general programming ones. The technical tools are text editors and IDEs. Key skills for this layer are all the general programming techniques, the specifics of whatever language is used, and usually some associated system tools (e.g. compilers). The finished product of this layer is a set of files containing code and documentation.</p>
<p>Next is the database schema. This is the most important layer because it defines the data that your application uses and stores. Historically this has almost always been a relational database (http://en.wikipedia.org/wiki/Relational_database), but in recent times non-relational databases (e.g. http://en.wikipedia.org/wiki/NoSQL) have become more popular. The conceptual tools at this layer include data modeling (http://en.wikipedia.org/wiki/Data_modeling), entity-relationship diagrams (ERD &#8211; http://en.wikipedia.org/wiki/Entity_relationship_model), normalization (http://en.wikipedia.org/wiki/Database_normalization), and data abstraction. The implementation tools include data modeling tools (http://stackoverflow.com/questions/166557/a-good-database-modeling-tool), text editors, engine specific utilities, and possibly framework-specific tools/utilities. Key skills for this layer are data modeling and the the technical skill of SQL (http://en.wikipedia.org/wiki/SQL). This finished product of this layer is a precise definition of the data that the application stores, and usually how each piece is related to others. Often this is in the form of files containing SQL.</p>
<p>Next is the database engine. This is the most important layer because it make the database schema actually work. Most engines will support most schemas, so the choices here tend to depend on budget and any specialized features required. The most popular open source database engines are MySQL (http://www.mysql.com/) and Postgres (http://www.postgresql.org/). The latter is slightly more technically tricky but has slightly more advanced features. The most common commercial options are Microsoft SQLServer and Oracle DB. Unless the web development work is for a large company, one of the open source packages is most likely, and in general MySQL is more likely than Postgres. Key skills for this level include basic operating system skills (at least installing and configuring software), DB system administration (e.g. how to implement a schema, how to back-up and restore a set of data, etc.) and use of whatever utilities a given engine has available (usually command-line tools or GUI for the open source engines and GUI tools for the commercial ones). Knowledge of SQL is also very important for this layer. The finished product of this layer is a system that fetches, stores, maintains, and controls access to the data defined in the schema.</p>
<p>Next is the web server software (http://en.wikipedia.org/wiki/Web_server). This is the most important layer because it allows communication between the client and the server &#8211; it puts the &#8216;web&#8217; in &#8216;web application&#8217;. From the web developer&#8217;s perspective there are three especially important aspects of web server software: configuration, tuning, and logging. Configuration is basically the process of getting it running at all &#8211; turning code on the server into web pages on the client. Tuning is the process of getting it to run well &#8211; making the application fast and reliable with as few resources as possible. Logging is tracking information about how the application is being used, and is especially important in debugging and performance monitoring. The most common and popular web server is apache (http://httpd.apache.org/), with nginx (engine-x &#8211; http://wiki.nginx.org/Main) coming into common usage for specialized, simple needs. Microsoft Internet Information Server (IIS) is used by some larger companies. Various languages and frameworks require particular additional modules or settings, but such things are generally well documented. Key skills for this level include basic operating system skills (at least installing and configuring software), and the technical skills specific to whatever software package is used. The finished product of this layer is the ability to view web pages served from that computer. NOTE: for a development system the computer on which you work is often the same as the one that&#8217;s running the webserver &#8211; that is, the same machine is acting as both host and client. This is fine as long as one access web pages via the server rather than the file system.</p>
<p>Finally, at the very bottom, is the operating system of the web host (&#8216;host&#8217; refers to the machine, to distinguish it from the server, which in general parlance can mean either the machine or the software). This is the most important layer because with out a web host nothing on the server side exists. This layer really subsumes a whole bunch of other, even lower level functions like network connectivity and firewalling and that kind of thing. However, a web developer rarely needs to know anything about that level (that&#8217;s all in the dark and mysterious realm of the network and system administrators). The OS level is usually of concern for the web developer in setting up and maintaining their development environment &#8211; the production environment is typically managed my system administrator specialists. Key concepts and skills of this level include system security, user management, persistence (backup and restore), software installation, update management, and configuration. Linux (http://en.wikipedia.org/wiki/Linux, http://en.wikipedia.org/wiki/Linux_distribution) is a good choice for an OS for web development (Mint (http://linuxmint.com/) and CentOS (http://www.centos.org/) are good versions/distributions), though work can certainly be done on Windows or Mac as well. Many inexpensive web hosting services offer a command line option, which is access to the operating system level. The finished product of this layer is a machine that runs and that one can log in to and connect to the internet with.</p>
<p>When developing a web application the layers are tackled in a different order, and since they&#8217;re interdependent usually work progresses on multiple layers at once. When developing the order is something like:<br />
1. application idea<br />
2. server business logic; client business logic<br />
3. client UI/UX design; web host; web server; database engine; set up development environment(s)<br />
4. database schema (and test/sample data)<br />
5. client UI/UX implementation; server side implementation</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ficial.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ficial.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ficial.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=229&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ficial.wordpress.com/2011/12/05/introduction-to-web-development-the-extended-web-stack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b2114837d693cd4a8ab4c44659dc66d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ficial</media:title>
		</media:content>
	</item>
		<item>
		<title>Postgres in Cygwin for Rails 3</title>
		<link>http://ficial.wordpress.com/2011/11/14/postgres-in-cygwin-for-rails-3/</link>
		<comments>http://ficial.wordpress.com/2011/11/14/postgres-in-cygwin-for-rails-3/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 03:24:11 +0000</pubDate>
		<dc:creator>ficial</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[techy]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[rails 3]]></category>

		<guid isPermaLink="false">http://ficial.wordpress.com/?p=224</guid>
		<description><![CDATA[I&#8217;m using Rails 3 on cygwin (on Windows 7). I used the cygwin setup utility to install all the postgres related packages I could find (all the Postgres items in the Databases group). For rails I used default configurations / system setting as much as possible. This means, among other things, that I&#8217;ve been doing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=224&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using Rails 3 on cygwin (on Windows 7). I used the cygwin setup utility to install all the postgres related packages I could find (all the Postgres items in the Databases group). For rails I used default configurations / system setting as much as possible. This means, among other things, that I&#8217;ve been doing all my development using sqlite. That was actually working just fine&#8230; until I started doing deploys to heroku. At that point I ran into the infamous &#8216;PGError: ERROR: operator does not exist: character varying = integer&#8217; problem. Somewhat reluctantly, I decided it was finally time to get Postgres running in my dev environment.</p>
<p>My Gemfile has:</p>
<pre>gem 'pg'</pre>
<p>and there weren&#8217;t any particular issues I ran into there (just the usual bundle install). The tricky parts were the database.yml settings, and getting postgres itself running. For the former I did a bit of googling and found a great set of examples at https://gist.github.com/961978. Adapting the postgres example was pretty easy. My database.yml looks like:</p>
<pre>development:
 adapter: postgresql
 encoding: unicode
 database: proj_development
 pool: 5
 username: projuser
 password: 12345dev # you may want something more secure here :P
 timeout: 5000</code>

# Warning: The database defined as "test" will be erased and
 # re-generated from your development database when you run "rake".
 # Do not set this db to the same as development or production.
 test:
 adapter: postgresql
 encoding: unicode
 database: proj_test
 pool: 5
 username: projuser
 password: 12345test # you may want something more secure here :P
 timeout: 5000

production:
 adapter: postgresql
 encoding: unicode
 database: proj
 pool: 5
 username: projuser
 password: 12345prod # you may want something more secure here :P
 timeout: 5000</pre>
<p>Getting postgres running took a quite a bit more research and experimenting. The difficulty I ran into was that much of the documentation out there is for systems other than cygwin, and cygwin has a number of idiosyncracies with respect to where various files live and that kind of thing. Two pages I found to be useful were http://beige.ucs.indiana.edu/I590/node149.html and http://www.postgresql.org/docs/8.4/static/installation-platform-notes.html. In addition to those I made heavy use of man and whereis to figure out where various commands resided and what exactly they did. The eventual sequence of successful (and relevant commands) was:</p>
<pre>$ /usr/sbin/cygserver &amp;
 cygserver: Initialization complete. Waiting for requests.</code>
$ cd
$ mkdir pgdata
$ cd pgdata
$ /usr/sbin/initdb .
 The files belonging to this database system will be owned by user "Chris".
 This user must also own the server process.
The database cluster will be initialized with locale C.UTF-8.
 The default database encoding has accordingly been set to UTF8.
fixing permissions on existing directory . ... ok
 creating subdirectories ... ok
 selecting default max_connections ... 40
 selecting default shared_buffers/max_fsm_pages ... 32MB/204800
 creating configuration files ... ok
 creating template1 database in ./base/1 ... ok
 initializing pg_authid ... ok
 initializing dependencies ... ok
 creating system views ... ok
 loading system objects' descriptions ... ok
 creating conversions ... ok
 setting privileges on built-in objects ... ok
 creating information schema ... ok
 vacuuming database template1 ... ok
 copying template1 to template0 ... ok
 copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
 You can change this by editing pg_hba.conf or using the -A option the
 next time you run initdb.
Success. You can now start the database server using:
/usr/sbin/postgres -D .
 or
 /usr/sbin/pg_ctl -D . -l logfile start
$ createdb proj_development
 CREATE DATABASE
$ /usr/sbin/createuser -P projuser
 Enter password for new role:
 Enter it again:
 Shall the new role be a superuser? (y/n) n
 Shall the new role be allowed to create databases? (y/n) n
 Shall the new role be allowed to create more new roles? (y/n) n
 CREATE ROLE</pre>
<p>Once all that was done I was able to run rake db:migrate (from my project folder, of course) to set up my tables, and then rails s to get my dev server going. Shockingly, those two steps went without a hitch, and I was able to use my application on my dev machine without any problem. Yay!</p>
<p>&#8230;.except that heroku is still unhappy and gives the same &#8216;PGError: ERROR: operator does not exist: character varying = integer&#8217; as I got originally. Dammit. :(</p>
<p>So, after re-examining all my migration files once more again from the start, I noticed this time that I&#8217;d some how used t.string instead of t.integer for a foreign key on an id field. Oops. I fixed that line, committed it, pushed to heroku, ran the db migration all the way down then back up, and POOF! IT WORKS!</p>
<p>Still, at least I learned something, and hopefully now you have as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ficial.wordpress.com/224/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ficial.wordpress.com/224/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ficial.wordpress.com/224/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=224&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ficial.wordpress.com/2011/11/14/postgres-in-cygwin-for-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b2114837d693cd4a8ab4c44659dc66d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ficial</media:title>
		</media:content>
	</item>
		<item>
		<title>Game Analysis Using Resource-Infrastructure-Action Flow</title>
		<link>http://ficial.wordpress.com/2011/10/23/game-analysis-using-resource-infrastructure-action-flow/</link>
		<comments>http://ficial.wordpress.com/2011/10/23/game-analysis-using-resource-infrastructure-action-flow/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 23:20:41 +0000</pubDate>
		<dc:creator>ficial</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game analysis]]></category>
		<category><![CDATA[game design]]></category>

		<guid isPermaLink="false">http://ficial.wordpress.com/?p=221</guid>
		<description><![CDATA[Since talking with Morgan McGuire a while ago about resource flow diagrams as a useful way to represent and analyze economic games I&#8217;ve been thinking off and on about ways to expand that idea. A resource flow diagram is a directed graph in which the vertexes represent in-game resources and the edges indicated that resource [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=221&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since talking with <a href="http://www.cs.williams.edu/~morgan/">Morgan McGuire</a> a while ago about resource flow diagrams as a useful way to represent and analyze economic games I&#8217;ve been thinking off and on about ways to expand that idea. A resource flow diagram is a directed graph in which the vertexes represent in-game resources and the edges indicated that resource of the initial vertex may be converted to the resource of the terminal vertex. </p>
<p>The first area I explored was the expansion of resources to more generalized game state dimensions.  In addition to explicit in-game resources the graph would include things like cards in hand, actions, and infrastructure. This quickly lead to two refinements. </p>
<p>I differentiated the vertexes into two sub-types. First were resources, explicit or implicit dimensions of the game state which are quantifiable. Second were actions, rules of the game that allowed the conversion of one resource to another. No resource vertex can be directly connected to another resource vertex, and no action vertex can be directly connected to another action vertex; edge paths alternate between resource and action vertexes.</p>
<p>Edges were also subdivided into two types. First were conversion edges, indicating that the resource of the initial vertex is consumed/reduced or that the resource of the terminal vertex is created/increased. Second were influence edges, which always have a resource as their initial vertex and an action as their terminal vertex. The resource of an influence edge is NOT altered. Resources the are the initial vertex of an influence edge are called infrastructure, distinguishing them from consumable resources (from now on called simply ‘resources’).</p>
<p>After trying to use this for analysis I found I needed a refinement &#8211; actions were split based on their inputs and outputs. E.g. in the simpler version there might be a trade action that has wood, cows, and gold as conversion precedents (direct predecessors), a market as an influence precedent, and wood, cows and gold as subsequents (direct successors). This would be useful in indicating that the trade action allows the conversion of one resource to another and that having a market affects that somehow, but the details are fuzzy. By splitting the generic trade action into separate actions (market and non-market for each transition) it became clear exactly how the game worked. That refinement also enables weighting each of the conversion edges. The weight indicates how much the initial vertex resource is reduced, or how much the terminal vertex resource is increased. This graph is the resource-infrastructure-action (RIA) flow diagram. It encapsulates how a game works in a vacuum, but does not take into consideration randomizers (though one can use expected values), nor player volition (though one can use a minimax framework). However, it can still be a useful tool. </p>
<p>The RIA flow encompasses the basic functionality of a resource flow diagram in that it illustrates how one in-game resource is converted to another, an eventually to the score/points ‘resource’. It allows us to quantify the efficiency of a path &#8211; take the total resource inputs, divide by the total outputs and the number of actions required. This path could be from resources to points, or merely from one resource to another. As a special case of a 2-edge long path, the efficiency of individual actions can also be analyzed &#8211; divide the inputs by the outputs.</p>
<p>On a slightly more subtle level, it simplifies analysis of the values of infrastructure. Consider two actions that have identical resources as inputs and outputs (though with different weights), but one also has an infrastructure as an input. The efficiency of the infrastructure is then the difference in the efficiency of those alternate action. This can be generalized to full paths &#8211; instead of two actions consider two paths from the same initial resources to points, one of which includes one or more infrastructure-enabled actions and the other of which does not.</p>
<p>An ‘engine’ in a game is an indefinitely repeatable series of actions that generates a net positive change in one or more resources. Building an engine is a key part of a successful strategy in many economic games. In an RIA flow, potential engines are easily identified as cycles in the graph. A cycle is an actual engine if the efficiency of the path is greater than 1 (a direct engine), or if it is equal to 1 but also has output leaves that are not in the cycle (a side-effect engine). The efficiency of an engine can be calculated as the output divided by the number of steps/actions to complete the cycle. In an infinite game the start-up costs of the engine (i.e. what needs to be done to establish the necessary infrastructure and/or gather the prerequisite resource set to prime it) are irrelevant compared to the output, but in a finite situation they come into consideration. One can calculate the expected start up time and and costs (the number of actions and resources needed), and the expected output over the remainder of the game to determine over all expected value of the engine. If the product of the engine is not directly in scoring, then one must also take into account the number of actions needed to convert the output to points.</p>
<p>priming actions = PA<br />
priming resources = PR<br />
engine cycle actions = CA<br />
engine cycle resources gained = CR<br />
actions needed to convert engine output into scoring = SA<br />
efficiency with which engine output is converted to points = CE<br />
efficiency with which PR could have been converted to points = PE<br />
total expected actions in game = GA</p>
<p>((GA-PA-SA)/CA * CR * CE) &#8211; (PR*PE) = expected net contribution to final score</p>
<p>Calculations get more complicated if actions may be pipe-lined, but the principle remains the same. There may be other useful digraph analytic tools that could be applied to an RIA flow diagram.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ficial.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ficial.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ficial.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=221&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ficial.wordpress.com/2011/10/23/game-analysis-using-resource-infrastructure-action-flow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b2114837d693cd4a8ab4c44659dc66d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ficial</media:title>
		</media:content>
	</item>
		<item>
		<title>Phusion Passenger &#8211; fixing &#8220;No such file or directory &#8211; git ls-files&#8221;</title>
		<link>http://ficial.wordpress.com/2011/07/13/phusion-passenger-fixing-no-such-file-or-directory-git-ls-files/</link>
		<comments>http://ficial.wordpress.com/2011/07/13/phusion-passenger-fixing-no-such-file-or-directory-git-ls-files/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 14:58:54 +0000</pubDate>
		<dc:creator>ficial</dc:creator>
				<category><![CDATA[code fixes]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[techy]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ls-files]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[phusion]]></category>

		<guid isPermaLink="false">http://ficial.wordpress.com/?p=218</guid>
		<description><![CDATA[I&#8217;ve spent several hours trying to get my rails app successfully deployed using capistrano to a phusion passenger environment, and it was all going well&#8230; except for the fact that the application wouldn&#8217;t actually run. I kept running into &#8220;No such file or directory &#8211; git ls-files&#8221;. After quite a bit of reading around I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=218&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent several hours trying to get my rails app successfully deployed using capistrano to a phusion passenger environment, and it was all going well&#8230; except for the fact that the application wouldn&#8217;t actually run. I kept running into &#8220;No such file or directory &#8211; git ls-files&#8221;. After quite a bit of reading around I finally found this discussion which helped a lot: http://code.google.com/p/phusion-passenger/issues/detail?id=505</p>
<p>There are a number of fixes discussed there. The one that finally worked for me was to run<br />
<code>ln -nfs /usr/local/bin/git /usr/bin/git</code><br />
since apparently where CentOS puts git and where the passenger code expects to find it are different. With that, everything worked fine. </p>
<p>I cannot decide whether it&#8217;s frustrating or gratifying to fix hours worth of stymieing with a single, simple command. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ficial.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ficial.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ficial.wordpress.com/218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=218&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ficial.wordpress.com/2011/07/13/phusion-passenger-fixing-no-such-file-or-directory-git-ls-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b2114837d693cd4a8ab4c44659dc66d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ficial</media:title>
		</media:content>
	</item>
		<item>
		<title>Cygwin and Rails &#8211; unable to remap to same address as parent; died waiting for dll loading, errno 11</title>
		<link>http://ficial.wordpress.com/2011/07/06/cygwin-and-rails-unable-to-remap-to-same-address-as-parent-died-waiting-for-dll-loading-errno-11/</link>
		<comments>http://ficial.wordpress.com/2011/07/06/cygwin-and-rails-unable-to-remap-to-same-address-as-parent-died-waiting-for-dll-loading-errno-11/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 18:44:28 +0000</pubDate>
		<dc:creator>ficial</dc:creator>
				<category><![CDATA[code fixes]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[techy]]></category>
		<category><![CDATA[errno 11]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rebaseall]]></category>
		<category><![CDATA[remap]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ficial.wordpress.com/?p=209</guid>
		<description><![CDATA[I recently switched to Windows 7 Enterprise and on the new system when I tried to do any rails work in cygwin this problem I&#8217;d been having intermittently on the old system: unable to remap FILE to same address as parent and ruby XXXX fork: child YYYY - died waiting for dll loading, errno 11 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=209&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently switched to Windows 7 Enterprise and on the new system when I tried to do any rails work in cygwin this problem I&#8217;d been having intermittently on the old system:<br />
<code>unable to remap FILE to same address as parent</code><br />
and<br />
<code>ruby XXXX fork: child YYYY - died waiting for dll loading, errno 11</code><br />
was a LOT more prevalent, to the point where it was hard to get work done.</p>
<p>I had done some research on this for my old system, and found quite a bit of discussion about this problem and how to solve it (e.g. <a href="http://www.garethhunt.com/2008/02/11/cygwin-died-waiting-for-dll-loading/">http://www.garethhunt.com/2008/02/11/cygwin-died-waiting-for-dll-loading/</a>, <a href="http://stackoverflow.com/questions/4988091/unable-to-start-solr-server-ruby-on-rails">http://stackoverflow.com/questions/4988091/unable-to-start-solr-server-ruby-on-rails</a>). Sadly, that approach (quit all cygwin shells, run c:\cygwin\bin\ash.exe, $ /bin/rebaseall) did not work for me then, and still wasn&#8217;t working on the new system. On my old machine I just ignored the problem since it wasn&#8217;t a blocker, but on my new system it&#8217;s really in the way, so I dove into it a bit more. I eventually came across this really helpful message by Illia Bobyr: <a href="http://cygwin.com/ml/cygwin/2011-04/msg00075.html">http://cygwin.com/ml/cygwin/2011-04/msg00075.html</a>.</p>
<p>In brief, the problem is that rebaseall doesn&#8217;t necessarily know all the .dll&#8217;s and .so&#8217;s it has to fix. The solution is to compose your own list and run rebaseall against that list using the -T option. For me, the process that finally worked was:</p>
<ol>
<li>in a cygwin shell:  <code>find /bin /lib /usr  -iname '*.so' &gt; /tmp/to_rebase.lst</code></li>
<li>in a cygwin shell:  <code>find /bin /lib /usr  -iname '*.dll' &gt;&gt; /tmp/to_rebase.lst</code></li>
<li>quit all cygwin shells and stop all cygwin processes</li>
<li>run as Administrator C:\cygwin\bin\ash.exe</li>
<li><code>/bin/rebaseall -T /tmp/to_rebase.lst</code></li>
<li>exit ash</li>
<li>restart machine</li>
</ol>
<p>And now, finally, I can code in peace&#8230;.</p>
<p>Until the next problem appears.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ficial.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ficial.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ficial.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ficial.wordpress.com&amp;blog=502495&amp;post=209&amp;subd=ficial&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ficial.wordpress.com/2011/07/06/cygwin-and-rails-unable-to-remap-to-same-address-as-parent-died-waiting-for-dll-loading-errno-11/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b2114837d693cd4a8ab4c44659dc66d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ficial</media:title>
		</media:content>
	</item>
	</channel>
</rss>
