tag:blogger.com,1999:blog-34565962906369521732024-02-20T16:52:06.585-08:00blog_t dev;Thoughts and Software of Jon McCaffreyAnonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-3456596290636952173.post-62370430596711127532013-12-04T22:25:00.000-08:002013-12-04T22:25:59.135-08:00Book Review: How Buildings Learn<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/en/thumb/9/91/How_Buildings_Learn_(Stewart_Brand_book)_cover.jpg/280px-How_Buildings_Learn_(Stewart_Brand_book)_cover.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/thumb/9/91/How_Buildings_Learn_(Stewart_Brand_book)_cover.jpg/280px-How_Buildings_Learn_(Stewart_Brand_book)_cover.jpg" /></a></div>
<br />
How Buildings Learn discusses how inhabitation and changing environment and demands shape a building while it is being lived in and used, how that learning process works, and how the style and structure of the building and the different parties involved can help or hinder this process.<br />
<br />
The first helpful mental model How Buildings Learn introduces is the shearing layers of change: Site, Structure, Skin, Services, Space, Stuff (and a half-joking 7th layer, Souls). These are the slow and quickly adapting layers of buildings; they range from the nearly-eternal site (a citys street grid can survive centuries, fire and earthquakes) to the ephemeral space and stuff plans, which are subject to constant activity (at the whim of that pesky Souls layer inhabiting the building). Freezing a mistaken decision in an immutable slower-changing layer (like structural elements that inhibit Space adaptation) creates pain for the buildings users forced to live in the poor and inflexible fit.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.bdarchitects.com/bd-MAP/wp-content/uploads/2010/12/pace_layers_building3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="298" src="http://www.bdarchitects.com/bd-MAP/wp-content/uploads/2010/12/pace_layers_building3.jpg" width="320" /></a></div>
<br />
<br />
Another broad and convenient framework the book introduces is Low Road and High Road architecture. Low Road buildings occur when people take over a space, often inexpensive, that allows them to improvise and get to work. These included converted factories, warehouses, garages, barns, boats, storage containers, and churches. These buildings learn because the building is not a precious item and so the inhabitantrs can work with it loosely and as they see fit.<br />
<br />
High Road architecture learns instead over generations of patient care. Stewart Brand draws the analogy to r-selected amd k-selected species. The book shows as examples the best cared-for country houses of England and the manors of America's founding fathers. High Road buildings last long enough to turn passing styles into history; doing one right is a labor of love measured in lifetimes. A humbler example given was the home of poets Una & Robinson Jeffers in Carmel. Built mostly by Robinson in local stone, he wrote in the mornings and worked on the home in the afternoon. The home included a stone tower with a quiet chamber for his wife and a playroom and secret inner staircase for their boys. <br />
<br />
One later chapter that I'd do well to learn the value of is Brand's paean to maintenance as a form of learning. In a cute phrase: "If you would ensure a building's longevity, protect it from markets and water, and feed it money, but not too much and not too little.". A basic idea from this chapter is that too much work and money usually go into the initial construction and not enough into gentle maintenance which allows the progressive correction of earlier missteps. Need buildings he suggests are especially dangerous because they initially hold together, delaying the formation of good maintenance habits.<br />
<br />
This chapter contains a helpful inventory of roof and construction materials from an aging and adaptability perspective. I hadn't realized the great difference in wear between wood stud framing and brick. Light wood construction is a very adaptable and easy to work with medium but it must be carefully sheltered from moisture and the elements. Brick, among others, has a completely different life cycle, but can last hundreds of years and stand up to much greater neglect and exposure. I'm not used to thinking of buildings as systems of materials instead of definitions of light and space.<br />
<br />
Another chapter with a fresh perspective was that on vernacular architecture; everything not designed by professional architects. There is an especially interesting section on American residential vernacular that discusses Cape Cods & ranch homes, bungalows, and mobile homes. I live now in an modest but unique apartment that is a really special space. Paying rent is a pure loss however, and we do sometimes miss a garden to grow in, a yard to stretch our legs, and patio to rest on. I hadn't considered some of the virtues of a small, modest, and flexible home; one that could find a spot in a real community, and be capable of growing and adapting with us. Brand in this chapter was very enthusiastic describing the vitality of these housing forms. It made me curious to wonder how much space is in one of the (quite nice) mobile home plots near Mountain View, given how much rents there are and the population of hackers and developers there who would appreciate inexpensive housing and flexibility. Another option to consider! One a bit off the path for my urban mind.<br />
<br />
An author Brand quotes frequently is Chris Alexander, another thinker and builder who has considered how buildings can adjust to house flourishing human lives and how those flourishing lives can come together in a way that graces their surroundings. I want to read his A Pattern Language: Towns, Buildings, Construction. It introduces the idea of design patterns; general patterns of solutions to archetypes of problems, and the format for presenting them. An exposition of similar patterns in the smaller realm of software design is Design Patterns: Elements of Reusable Object-Oriented Software.<br />
<br />
How Buildings Learn struck a strong contrast to what I'd learned about Modern & Postmodern architecture. I took a single course on modern architectural history, and one aspect I always found a bit odd about the way it was taught is that it focused on a few select buildings which set and typify style, forming a microscopic fraction of the world's construction, and not the rules and patterns according to which most building are actually built. Based on Brand's references to many of the same figures, movements and exemplars, (proto-modrrn works like the Eiffel tower, the International style and its later adherents like Im Pei, and its manifestation in commercial and institutional buildings, and then Robert Venturi and later Postmodern adventures) this was not a deficiency of this particular course, but a fair sampling of the evolution of thought in high architecture.<br />
<br />
Viewed less as an artform, the profession of architecture is structured in several ways that hurt clients. The architect has little incentive in many contracts to make sure the building serves and adapts into its first years of occupancy. Architects' contracts are also not always structured to encourage minimizing and meeting costs and producing buildings that will be simple and joyful to maintain. Facilities management & construction management that Brand mentions which have sprung up to fill this gap.<br />
<br />
One small kinship I had with the author is that he lived and wrote from Sausalito, so the book is rife with Bay Area references. He mentions houseboats in Sausalito, converted garages in San Francisco, homesteads in Campbell & Point Reyes factories, converted to office space in Emoryville, and surplus military sheds in Mountain View. The geographic immediacy enriched the book for me.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-85508416264210222152013-11-25T15:01:00.000-08:002013-11-25T15:01:15.038-08:00Networks, Crowds, and Markets Review: Parts I-IV<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://assets.cambridge.org/97805211/95331/cover/9780521195331.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://assets.cambridge.org/97805211/95331/cover/9780521195331.jpg" /></a></div>
<a href="http://www.cs.cornell.edu/home/kleinber/networks-book/networks-book.pdf">Full Book Text Available Here</a><br />
<br />
Parts I-IV of this text cover graphs and networks, game theory, markets and auctions, and touch on information networks, search techniques, and advertising markets.<br />
<br />
This book was interesting in that it introduced me to some new ideas, bordering on concepts I was familiar with, with a very basic level of mathematical understanding required. I'm familiar with graphs from an algorithms point-of-view, so the sociological viewpoint in Part I was fresh to me, even though the material was not too advanced. I had also never been exposed to the ideas in game theory or evolutionary game theory, so I thought they were valuable fresh conceptual tools.<br />
<br />
Part I introduced a number of sociological concepts in networks to me. Homophily is the tendency to befriend, bond with, and be associated with, people similar to yourself. Triadic closure is the idea that 'triangular' relationships between 3 people are likely; if people A and B have bonds to a common C, it is likely that A and B will be associated. Triadic closure can be extended by adding a notion of tie strength. The Strong Triadic Closure property says that if A and B have strong ties to a common C, A and B are almost certainly associated.<br />
<a href="http://networksingularity.com/images/7/9/6/0/6/170976-160697/NCM_3.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="195" src="http://networksingularity.com/images/7/9/6/0/6/170976-160697/NCM_3.gif" width="400" /></a><br />
An interesting global property that falls out of this local one is that 'local bridge' connections between cliques in networks are usually weak ties, because otherwise the Strong Triadic Closure property would mean that more people in the clique would be associated, and the bridge would no longer be a bridge. The common-life corollary to this is that new job offers and opportunities often come from weak associations.<br />
<br />
Structural balance is another (somewhat dangerous/unfortunate) idea that adds support and antagonism to networks, 'signing' them. All edges between nodes in the network are labeled either with + for positive or supportive relationships or - for opposing, antagonistic relationships. Structure balance looks at triangles of edges between nodes and says that +,+,+ triangles and +,-,- triangles are 'stable'. +,+,- is unstable because it corresponds to the situation in which 2 mutual friends of a third-party dislike each other. The third-party will pressure his friends to get past their grievances because it stresses the relationships. -,-,- is unstable because the incentives are strong for 2 nodes in the triangle to 'team up' against the third. <br />
<br />
Structure balance then states that global network properties occur if these structural balance properties hold locally. In particular, if the network is fully-connected and all nodes have a positive/negative relationship with every other node, and the structural balance properties hold everywhere, the network will be divided into 2 opposing camps. This can be applied towards explaining some of the vexing consequences of alliances in international relations. The authors also generalize this in 2 dimensions, by removing the requirement that the graph be fully-connected and removing the requirement that the structure balance property hold locally everywhere.<br />
<br />
The chapters on game theory were also useful to me, especially in terms of understanding how rational behavior can lead to socially stupid outcomes. I feel like I have a better eye for incentives now, how they drive behavior, and how they could be adjusted for better overall outcomes. The section on auctions was particularly helpful for the later sections on markets in a network context; the book built well off its foundational concepts there. <br />
<br />
A book I am considering as a follow-on to Networks, Crowds, and Markets is Algorithmic Game Theory [http://www.cambridge.org/journals/nisan/downloads/Nisan_Non-printable.pdf], which includes sections on mechanism design; the design of markets, auctions, and other mechanisms that try to make rational behavior of individual actors work for the social goals. This book also has chapters on reputation systems, peer-to-peer systems, routing and allocation and prediction markets.<br />
<br />
Parts III and IV are less foundational, and more focused on applying the earlier ideas in network contexts. I'm not sure many of these ideas will be code-applicable for me yet, but I would feel more confident reasoning about the behavior of entities like Amazon, Google, and SaaS companies. After reading this I'd be in interested in looking at algorithms for determining prices and matchings, like balanced outcomes in the surplus-splitting game, or VCG prices for multi-buyer, multi-seller options, and how one would prove properties like balance, stability, and equilibria. I'd be especially interested in algorithms over larger, non-trivial networks, results that take information asymmetry more into account. Algorithmic Game Theory may address some of the former, and the later parts of Networks, Crowds and Markets the latter.<br />
<br />
I'm not sure I'd recommend this book yet overall, the conceptual punch per page quotient doesn't seem too high. The initial chapters make good expositions to networks and game theory in their own right. I'll report up on final thoughts and the later parts of the book once I finish them.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-55838871906227973352013-10-31T19:42:00.005-07:002013-10-31T19:44:02.726-07:00Book Review: Ishmael<div>
<a href="http://upload.wikimedia.org/wikipedia/en/a/ab/DanielQuinn_Ishmael.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://upload.wikimedia.org/wikipedia/en/a/ab/DanielQuinn_Ishmael.jpg" width="205" /></a></div>
<a href="http://ansonchi.webng.com/ishmael_by_daniel_quinn.pdf">Ishmael Full Text Link</a><br />
<br />
Modern man's original sin, which nettles me each time I fly home, or drive further than is essentially necessary:<br />
<blockquote class="tr_bq">
<b>"You’re captives of a civilizational system that more or less compels you to go on destroying the world in order to live."</b></blockquote>
This book held sadness for me but some wise lessons and hope.<br />
It asks what myths our culture has. A myth doesn't have to be completely fantastical to be a myth, just a story of the world that captures culture's beliefs and values. Some civilized myths I see are a tidy linear notion of progress, a belief in the exceptionalism, superiority, and unity of any nation, and the idea that we all have access to the same opportunities and gifts in life. <b>The core myth that Ishmael examines is the evil human conception that the world is made for us</b>; that the natural world has value solely as its useful or enjoyable to people. As Ishmael points out, this belief has had severe consequences in an ecological instant. Like any belief or model that diverges too far from reality, it must eventually and painfully deflate.<br />
<br />
I think the implicit belief that the world exists for our use and convenience does seem to be reflected in many of our actions, and we may be heading towards a point when that belief could collapse. <a href="http://biology.duke.edu/wilson/EcoSysServices/papers/VitousekEtal1986.pdf"> Human Appropriation of the Products of Photosynthesis</a> estimates that our species is consuming or displacing 40% of the biomass of the planet. This is such a large percentage where we can no longer count on the rest of the system to stabilize itself and our contributions to the load; we can easily throw the entire system out of balance.<br />
<br />
Another critical message of Ishmael is that our window of time of recorded history is a minuscule slice of time on evolutionary, planetary, and cosmic scope. Events we think of as ancient history are a few hundreds of generations ago; stories enacted by creatures so genetically near to us as to be indistinguishable. Our few thousand years of experience of abjuring our place in nature and trying to chart our own history weigh against the few million years of stability achieved by mankind prior to that, and the hundreds of millions of years organized life has survived and thrived prior to that. If that stability seems threatened now, our lack of perspective, alienation and self-centered values are to blame.<br />
<br />
Many of creation myths we are familiar the place man somewhere between gods and animals, showing our powerful tendencies to place ourselves above the herd. Accepting that instead we are short-lived conscious animals produced after epochs of selection and made of the same cosmic muck as the rest of the world actually feels pretty liberating.<br />
<br />
It's not too late to redeem ourselves, though the world is churning forward recklessly fast. We can accept our place in natural life as a fascinating and unusually social twig on the great evolutionary tree of life hundreds of millions of years old, and recognize that though we live and die in a few score trips around the sun, this planet or others can play host to thriving life for a few billion years. We are not the final culmination of natural or intelligent life (nor is evolution the kind of optimization process that produces a final culmination) but we are clever, powerful and perhaps wise enough to act as stewards, not masters, of this bequeathment of life, for a time.<br />
<br />
In terms of what forms our society might take to meet such ends I'm not sure. <br />
How can we undo the hateful parts of the future we are barreling towards? Still on my reading list,<br />
<a href="http://www.amazon.com/Whole-Earth-Discipline-RestoredWildlands-Geoengineering/dp/0143118285">Whole Earth Discipline</a> proposes nuclear power and dense urbanism. Population-wise we are likely already over our planets sustainable carrying capacity, so I think slowing or reversing that growth is essential. I think much of the work to be done is social and spiritual as Gary Snyder suggests (<a href="http://forums.delphiforums.com/n/main.asp?webtag=overpopulation&ctx=&cacheTag=59-25&msg=1333.2">http://forums.delphiforums.com/n/main.asp?webtag=overpopulation&ctx=&cacheTag=59-25&msg=1333.2</a>); we need to undo fearful and compulsive thinking, both individually and collectively, to enable us to live in the world compassionately and without avarice. Goal is that we may be able to demand less from the ecological web we are begrudgingly part of, without abandoning the knowledge, technology, or connectivity we have gained to date, so that we and untold generations to follow may live peaceful, prosperous, meaningful and fulfilled lives that our ancestors, foragers or farmers, would be proud of.<br />
<br />
Footnote:<br />
Ishmael spends a fair bit of time discussing the conflict between "Leavers" & "Takers", low-population foraging people and sedentary, domination-oriented agriculturalists. One recent take I read about this conflict and transition (<a href="http://www.pnas.org/content/110/22/8830.full">Coevolution of farming and private property during the early Holocene</a>) which is discussed here:<br />
<a href="http://lordoftheapes.blogspot.com/2013/06/agriculture-and-property.html">http://lordoftheapes.blogspot.com/2013/06/agriculture-and-property.html</a> talks about how the development of agriculture is closely tied to property rights; a farmer can gather in times of plenty and then not be compelled to share that surplus in times of famine. Agriculture and property rights are a bit of a chicken-and-egg phenomenon, but they compose an evolutionarily stable strategy in simulation, which may, for moral and ecological better or worse, explain their dominating spread.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-33843888155894874052013-10-26T19:04:00.001-07:002013-10-26T19:04:18.809-07:00Book Review: Topiary<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.oliveropenpress.com/art/Topiarycover.02.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://www.oliveropenpress.com/art/Topiarycover.02.gif" width="224" /></a></div>
Full text link:<br />
<a href="http://dissidentvoice.org/wp-content/uploads/2012/11/Topiary.pdf">http://dissidentvoice.org/wp-content/uploads/2012/11/Topiary.pdf</a><br />
<br />
What a disturbing book! Not a great classic, but a potentially powerful tale in our time. Contrary to some reviewers I found this non-traditional parable readable, and what I understood I found disturbing. Topiary is set in a nightmarish version of our own world and New York City in particular, where the technocratic engines of society (reduced from their familiar branding to singular titular entities: The Nation, The City, The University, Big Media, Tree of Knowledge Incorporated, The Network, The Infocracy) churn forward like a monstrous machine with no organic life left in them at all.<br />
<br />
The identity of the protagonist resonated with me. He is a younger man (and a bit of a hack in school, not a true artist) who worked at an ad agency (rather The Ad Agency!) producing pure talk and false images to incite desire. Lost and disillusioned by this work, he quits become Plantman, the maintainer of corporate flora. His travels then take him through the offices and personalities of this nightmarish world, maintaining the few spots of life still found among the high rises where only money lives. Though I have more hope for its value, I feel a bit lost and disillusioned in corporate knowledge work myself. It sometimes runs contrary to the values and environment I held dear growing up, and those that people have lived with for a hundreds of thousands of years; perhaps I'm also meant to be a Plantman? <br />
<br />
One of the issues I struggle with in my work (system software development) is separating out the accidental difficulties from the essential. One item that stresses me greatly that seems almost entirely accidental is the working conditions; a cubicle to sit in in a nearly windowless building for roughly fixed hours per day. Our buildings are interspersed with green walkways, and one can escape with a laptop to work outside the usual box, but I keenly feel the alienation and isolation from our ecosphere that Plantman mourns.<br />
<br />
This novel is as a trip through our own contemporary society, particularly the elements perceived as admirable, powerful and influential, without the benefit of our myths, heroes and culture to cover the sharp edges. Plantman is particularly critical of the role of media in both commercialism and nationalism. <br />
<br />
With shame, I remember my attitudes as a younger man when America first invaded Iraq. Even without television, I remember listening to radio coverage of our devastating opening bombardment (Shock and Awe? What egotistical merda of a name is that?) with cheerful, tidy nationalistic pride. Over the course of Topiary, The Nation wages a highly televised, one-sided The War with a Rogue Regime. It blasts on prime-time in HD, and shows on giant televisions in the gym for employees to pump their body too. There is little discussion about what weighty concern, grave necessity, or painful tortured moral cause led The Nation into war; it is nearly a media production to unite The Nation and The Citizens.<br />
<br />
The crass, self-conscious use of artistic methods and expressions to incite desires and drive sales for private profit is a subject of intense criticism in Topiary. Plantman's first soul-draining job is as a copy-writer.<br />
<br />
As I see the world, we put a dangerous load of fragile ecosystems and non-renewable resources that may well doom us. Buddhism and other traditions teach that one of the primary weaknesses of human nature is our predilection to desire that which we do not have; we always want more, more, more! Even with little natural encouragement. We also have a foolish proclivity to always seek novelty and fit images, roles, and groups that our presented to us.<br />
<br />
To then dedicate the talents, energy, and effort of intelligent, driven people to exacerbate these natural weaknesses, spurring higher consumption and greater drain on our shared planetary resources, is irresponsible and unethical. Consumeristic drives say that a product can balm some wound inside of us, can provide meaning, or makes us the people that we want to be. In Topiary, Plantman's prime work as a copy-writer is EARN, a polished but completely crass ad campaign for a designer perfume that comports to be bottled sexual desire. The cynical centerpiece is a print of a naturalistic wedding of unattainably beautiful beings entitled "EARN the moment. Forever".<br />
<br />
Many of cultural criticisms I've mentioned are well-worn to astute observers, but Topiary, aided by it's non-traditional syntax and narrative structure and dystopian subversion of modern life, relays them with a freshness and immersively disturbing quality that is like plunging your head into an ice-cold bucket and being held under unable to breathe. The overriding arc of the book is that the frenzy, complexity, impersonal economics, and mechanization of modernity squeezes out the life in the world and in us. Topiary highlights the scope of the changes we should make in how we live, the consequences each of us face for acting without caring or thinking, and the despair that could await us if we don't act to live our lives and change our world for the better.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-14208948866243627342013-10-19T12:47:00.002-07:002013-10-19T12:47:36.708-07:00The Great Divorce Review<div class="separator" style="clear: both; text-align: center;">
<a href="http://icrucified.com/icruciblog/wp-content/uploads/2013/04/thegreatdivorce.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://icrucified.com/icruciblog/wp-content/uploads/2013/04/thegreatdivorce.jpg" width="240" /></a></div>
<br />
<br />
I'm doubtful of literal supernatural truth to a Christian afterlife, but I thought that The Great Divorce was a thought-provoking exploration of the limits and traps of human nature, behavior and cognition. In the same way that from a cosmic perspective, we live in a vast, profound,ancient and wonder-rich universe, but we spend much of our time bound in small human struggles and to tied to earthly pursuits and possessions, the shades in The Great Divorce each had their own ball & chain binding them to their condemned state; their own attachments preventing them from realizing salvation, each one a cautionary tale about cognitive, social and behavioral traps that keep us from realizing the greatness of the universe, and our belonging to it.<br />
I found the narrative structure of the story effective. The structural similarity to Dante's Inferno, with the narrator finding himself without explanation in this strange land with his mentor, is a natural choice. The manner in which the world around him has no immediate explanation, but all the people speculate about it to each other. This evoked for me how we all find ourselves on earth, in a vast and complicated social and natural world with no obvious meaning, but we all search for such meaning and understanding together over our lives. Their abrupt, contextualizing openings are similar as well:. The Great Divorce starts "I seemed to be standing in a busy queue by the side of a long, mean street"; Dante's Inferno "In the middle of the journey of our life, I came to myself, in a dark wood, where the direct way was lost." These both are apt ways to begin dream-parables (what were you doing before you find yourself in a dream-world?) The contrast is that this is a tale based off a modern world much like our own.<br />
I found the strange behavior of changing scales, time & dimensions in The Great Divorce evocative. Hell/Purgatory is present but seems immaterial, and new streets and houses can be simply wished into existence. There are few social ties or bonds of affection to hold people together and souls seem bitter and unpleasant, so the city sprawls and the world stretches on millions of miles almost empty, and curves in some odd way. One of the residents uses a telescope to look across it, like the city itself is a cosmic sphere.<br />
Yet when the bus departs out of Hell/Purgatory, looking back what seemed to have been a vast chasm looks in retrospect to be a miniscule crack. I thought (somewhat ironically) about <a href="http://www.youtube.com/watch?v=1APOxsp1VFw">Richard Dawkin's Middle World idea</a> ; that we experience the universe as we do because our brain's are tuned for existence at certain scale, timespans, and energy levels, and we perceive time, scales, and energy levels with respect to that. We can reason abstractly about behavior at other scales (especially using science and mathematics, tools that do not rely so heavily on our intuitions) but the conclusions about the universe we arrive at may "do violence to our common sense". We might imagine that from an alien perspective, rather than "in the trenches", our own moral trajectory as individuals or a species might appear very differently.<br />
At the end of the story, before the narrator awakens, he has a flash of an illusion that what he is seeing is another perspective of mighty and vast immortal souls and ideals interacting with the finite and temporal chessboard of existence we inhabit; another slice of the intersection between the eternal and the everyday. I feel a similar perplexity (that almost interferes with my work and projects) when I try to understand how mathematical truths are derived from reality. It's hard to imagine Platonic ideals existing beyond physical reality, but <a href="http://www.dartmouth.edu/~matc/MathDrama/reading/Wigner.html">The Unreasonable Effectiveness of Mathematics in the Natural Sciences</a> begs explanation to our minds. This similarity may not have be foreign to Lewis's mind; in the <i>Screwtape Letters</i> he writes:<br />
<blockquote class="tr_bq">
<span style="background-color: white; font-family: Georgia, serif; font-size: 16px;">Above all, do not attempt to use science (I mean, the real sciences) as a defence against Christianity. They will positively encourage him to think about realities he can't touch and see</span></blockquote>
Another idea I found evocative from The Great Divorce was that salvation or damnation were retrospective; if a soul arrived in heaven, time in Hell retrospectively became Purgatory, and earthly agony became glorious trials. However, for souls stuck in Hell, even their prior pleasures or triumphs were poisoned and soured into their downfall. I found traces of how happy older people have described earlier times of struggle in this metaphor. The other secular idea it reminded me of is that selfish concerns that give us immediate temporal pleasure are ultimately shortsighted and unsatisfying. In a glorious, mysterious universe without obvious anthropomorphic divinity and great doubt about the existence of individual immortal souls, a high aim we can hope for is to understand our own place and belonging to the cosmos and work to bring about a joyful future for other people, life-forms and intelligence who come after us and share the world with us, and savor our own brief time on the planet. Even if immortal ideals don't independently exist in a Platonic sense, we can still strive towards them. It's not a traditional after-life but it may be the best we got.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-85593858339880799142013-04-16T22:45:00.002-07:002013-04-16T22:47:25.170-07:00How to Be Useful<a href="http://www.amazon.com/How-Be-Useful-Beginners-Hating/dp/0618713506" imageanchor="1"><img border="0" src="http://laist.com/attachments/la_christine/How%20to%20Be%20Useful.jpg" /> </a><br />
<br />
<a href="http://www.amazon.com/How-Be-Useful-Beginners-Hating/dp/0618713506">How to Be Useful</a> is an interesting little book that recaps the highlights of success literature in the 20th century. I read it in parallel with <a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745">Rework</a>, which takes a very 21st century approach to business and work, and struck an interesting contract. Some of Paul Graham's essays such as <a href="http://paulgraham.com/marginal.html">The Power of the Marginal</a> also came into my mind as counter-arguments. The initial snag of this book for me was the quirky cover and fetching title. How to Be Useful: A Beginner's Guide to Not Hating Work. Well, I consider myself a beginner, I certainly hope to be useful, and I definitely don't want to hate work, so this seemed like the book for me!<br />
<br />
I had a wonderful and rich childhood and education (both of which prepared me well for software engineering) but I had little previous exposure to the office and the corporate institution, so this book was a helpful aggregate of others' hard-won (and occasionally gimmicky) thoughts on the subject. I also found relevant the experiences the author included from her own time in publishing, which seems to be far more ruthless and careerist than software, but similarly structured.<br />
<br />
The structure of the book is interesting. The chapters follow a chronological progression in the time of the literature being examined. They also roughly follow a progression in the duration of employment at one position, from making striking first impressions to firing yourself in preparation for moving onwards and upwards.<br />
<br />
The main resolution I took from the reading is that if you take how special and unique and interesting you are and<i> shove it</i> for a bit, and get busy to solving other people's problems and making their lives easier, professional success hopefully follows.<br />
<ul>
<li><b>On Being a Poseur</b>This chapter makes a solid argument for it being morally sound and commendable to pursue a successful career, separate from base material desires, and to earnestly strive with all your capabilities, not just "hard work", for the things you want to achieve. It also criticizes the ironic detachment and disdain young and educated people sometimes have for professional life. Why try to act like you don't care about the things you care about? There isn't enough time for irony.</li>
<li><b>Dodging the Great Failure Army</b>An interesting chapter that focuses on Andrew Carnegie and the dawn of white-collar work. The bit that spoke to me the most was that while we are each multi-faceted and endlessly fascinating people, of great individual worth and virtue, you perhaps shouldn't be your uninhibited natural self in your professional position. To quote:
"Forget yourself, he essentially said, and maybe try being somebody else a few hours a day. Maybe somebody better than you."</li>
<li><b>Party Tips for the Nouveau Riche</b><br />The best ready advice from this chapter was that acting questions both makes you a better conversationalist and less overbearing to your co-workers, it's a good way to find your bearings in an organization.</li>
<li><b>On Near Universal Self-Absorption</b><br />"Why talk about what we ant? That is childish. Absurd. Of course, you are interested in what you want. You are eternally interested in it. But no one else is."</li>
<li><b>The Master Mind</b><br />This chapter discusses building a valuable circle of friends. "Once you've found people with whom you can openly, sincerely discuss what you wish for, you spend less time dwelling on the pedestrian events of the day, or the smell of your cubicle neighbor's tuna sandwiches, and more time talking about things you actually want to bring into existence."</li>
<li><b>Checking Yourself at the Door</b><br />On the advantages of dressing in upper-middle class styles: "While everyone else wrung their hands about how bad, how very sad, it was that all America was <i>conforming</i>, these thinkers started toying with the notion that blending in actually has its advantages. Indeed, it has a kind of subversive power."</li>
<li><b>When It's Not Just About You</b><br />Anecdote: "The downside to meritocracy is that those born on third base think they hit a triple, and everyone else is subject to self-loathing."</li>
<li><b>Interlude (Why Most Everything from the 1970's Doesn't Help)</b><br />Shortly: everything written then presumed people were dumb. And presuming that your audience is dumb never made for a quality product.</li>
<li><b>Self-Deprecation</b><br />This chapter advertises self-deprecation as a useful tactic, especially for surviving "So where did you go to school" type conversations. I like to think that this isn't necessary in 2013, but it may be.</li>
<li><b>On Defense</b>One of my goals in life is to remain fearless enough to admit my errors freely and move to correct them directly. Intellectual honesty above much else. This chapter advertises a similar ethic.</li>
<li><b>The Uses of No</b><br />As a software engineer, I love the concept of "firing yourself". I think that the highest professional goal a programmer should shoot for in a given position is writing such excellent software, tests, tooling, and documentation that you can simply walk away from your duties and have them keep themselves running. How much more courageous and less petty than making yourself necessary.</li>
</ul>
Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-57192463996201362232012-01-15T19:14:00.000-08:002012-01-16T11:16:35.390-08:00YTinstantI made a clone of ytistant to learn more about client side scripting.<br /><br />You can play with it <a href="http://mccaffrey-jonathan-ytinstant.herokuapp.com/">here</a> or get the source <a href="https://github.com/mccaffrey-jonathan/ytinstant">here</a><br /><br />Not sure how permanent these heroku links are...Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-33733367341306571102011-05-10T22:07:00.000-07:002011-05-10T22:16:16.832-07:00Google I/OOn the train back to Philadelphia from the Google I/O Extended<br />conference in NYC. Props to Google NYC for hosting us for the streaming session and showing us around.<br /><br />The Google NYC offices in the Port Authority building in Chelsea are<br />neat. I'm a sucker for the converted warehouse look, so it appealed to<br />me straight away. They still had alot of hustle and bustle getting the<br />space put together and remodeled, and expanded into new parts of the<br />building. One architectural feature I found funny was that their main<br />common spaces/auditoriums/rec rooms were located in the loading docks<br />for their (still working) truck elevators.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.neowin.net/images/uploaded/old-port-authority-nyc2.jpg"><img style="cursor:pointer; cursor:hand;width: 550px; height: 499px;" src="http://www.neowin.net/images/uploaded/old-port-authority-nyc2.jpg" border="0" alt="" /></a><br /><br />There was a big focus on Android graphics and HTML5 capabilities at the<br />sessions they showed us, which was really encouraging. I'm curious<br />about the capabilities of their RenderScript. It seems like the<br />documentation and examples are rather sparse, but it is some kind of<br />OpenGL wrapper + CUDA approximation that allows for high-performance<br />rendering or compute (simulation, encoding/decoding) that can run on<br />either the GPU or CPU as is appropriate. <br /><br />Rather than Dalvik, then use an LLVM intermediate representation that is<br />targeted to the CPU's or GPU's available at run-time, which reminds me<br />of the Apple OpenGL emulation system using LLVM. This, plus the fact<br />that anyone that can is using LLVM as their back-end, really makes me<br />think I should pick it up. One nice RenderScript feature is that their<br />compiler automatically generates Java .class files for you that make<br />binding from your Android app quite painless.<br /><br />I'm a little sad that Google chose to rebuild this stack rather than<br />support OpenCL and build a similar abstraction on top of it; I'd be<br />curious to hear the rationale. I don't think RenderScript will find for<br />larger software systems (serious physics engines, math libraries)<br />without more of a cross-platform nature; it's a pity they couldn't have<br />leveraged such that already exists for OpenCL, which promises alot of<br />the same benefit of heterogenous platform support.<br /><br />Another good talk I saw was the Android ProTips. He actually ran over<br />alot of the same points on watching battery, connectivity, and docking<br />state that were covered in CIS542, Embedded Systems. He also showed<br />some really nice tricks using PassiveLocationProvider to take advantage<br />of Location updates that other apps requested to keep yourself<br />up-to-date.<br /><br />Really, the number of system events that can be captured<br />and handled using Intents is really impressive, and one of my favorite<br />features of Android as a platform. I thought I was really clever when<br />we used them to capture document opening for SEASPrint, but apparently<br />that's just best practice.<br /><br />Another neat Android library I learned about today in passing is<br />FileObserver, which is a low-level and powerful utility that I wasn't<br />really expecting. It's just a wrapper for the Linux inotify library,<br />but it let's you do neat things like the shader preview tool I talked<br />about last fall. <br /><br />It's probably not that great a tool for general IPC since Android<br />applications view of the filesystem is really restricted, and there are<br />already higher-level tools like Intents to pass media and messages<br />between applications, but I can see it being used in content development<br />to push out asset changes to the phone during development for<br />interactive preview. Noone likes reinstalling an app to see changes.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://images.intomobile.com/wp-content/uploads/2010/05/io2010logo.png"><img style="cursor:pointer; cursor:hand;width: 500px; height: 263px;" src="http://images.intomobile.com/wp-content/uploads/2010/05/io2010logo.png" border="0" alt="" /></a><br /><br />At the reception after Google I/O, I bumped into one of Google's engineers for<br /><a href="http://bodybrowser.googlelabs.com/">Google Body</a>, which uses alot of WebGL to render some really high resolution<br />datasets. I'd been curious about streaming 3d assets into the browser, so he<br />was really great to talk to.<br /><br />He had some great points about the tradeoffs in streaming, storing, and<br />decompressing data when your host code runs in Javascript and your<br />rendering runs in accelerated OpenGL. This is especially difficult<br />since in Javascript you can't access custom native libraries for<br />compression/decompression or asset preparation. One option is using<br />browser builtin's like Gzip or Deflate content-type encoding to handle<br />your compression for you.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.geeky-gadgets.com/wp-content/uploads/2010/12/Google-Body-Browse.jpg"><img style="cursor:pointer; cursor:hand;width: 650px; height: 390px;" src="http://www.geeky-gadgets.com/wp-content/uploads/2010/12/Google-Body-Browse.jpg" border="0" alt="" /></a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-65024818478282862142011-05-10T22:05:00.000-07:002011-05-10T22:16:40.377-07:00Test Driven Development: by ExampleOn the way back home Sunday, I also read most of <a href="http://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530">Test Driven<br />Development</a> by Kent Beck, who is an author I have heard referenced alot<br />but never read.<br /><br />Good quote: "Every programming practice encodes a value system,<br />explicitly of implicitly"<br /><br /> --Kent Beck<br /><br />I used a fair bit of TDD on the mail server project, as well as<br />conformance testing, system testing, stress testing, and a dash of<br />regression testing. The SMTP protocol logic especially was developed<br />incrementally and test first. <br /><br />The book was alright, the first step-by-step example was <br />a little wandering but eventually enlightening. I actually liked the<br />end of the book more, where he gives a large review of test patterns, as<br />well as design patterns and refactorings as applied to TDD.<br /><br />One of the sections I enjoyed most was "How do you know if you have good<br />tests?". For me, one of the greatest benefits of TDD isn't that you<br />are left with tons of test artifacts that you can use for verification,<br />refactoring, or maintenance. It's that you can continually,<br />incrementally, and easily fire up and exercise your code base in little<br />chunks. <br /><br />In this section, Kent Beck points out that bad tests can be an<br />indication of bad design in the production code. If you can't get your<br />code in a test hardness because of external dependencies of filesystems, <br />servers, or databases, it isn't the fault of unit-testing as a<br />discipline; your production code has too many dependencies. Similarly<br />if you feel you are instantiating 2/3rds of your code base to run one<br />object. Because unit tests exercise chunks of the codebase separately,<br />they verify that you really do have a modular design, and provide alot<br />of motivation to extract interfaces and encapsulted complicated and<br />concrete implementations.<br /><br />This spat of reading on software engineering has really gotten me to<br />thinking about how to backport these techniques to languages less<br />focused on encapsulation and dynamic polymorphism (read: C). I might do<br />a series on modern and modular design techniques in plain-old C. It'd<br />be stuff most professional developers probably know about, but that<br />wouldn't show up in K&R.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photo.goodreads.com/books/1174359847l/387190.jpg"><img style="cursor:pointer; cursor:hand;width: 399px; height: 500px;" src="http://photo.goodreads.com/books/1174359847l/387190.jpg" border="0" alt="" /></a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-13309883626377025192011-05-10T22:03:00.000-07:002011-05-10T22:17:01.353-07:00Seven Languages: IoI took the train from home in Upstate New York to New York City today to<br />go to the Google I/O streaming sessions tomorrow, and it's a beautiful<br />day along the Hudson. I took the opportunity to work through the Io<br />chapter of Seven Languages.<br /><br />Io is a prototype language, meaning that to create new objects, one just<br />clones an existing object, called a prototype, rather than instantiating<br />a class. I found this to be a simple model that makes reflection very<br />simple and natural. There is no reason to have, for example, Python<br />meta-classes, when you don't even have classes! To "inherit"<br />functionality, you clone your base object, add some functionality<br />dynamically, and then clone from your new prototype.<br /><br />Another feature of Io I found distinguishing was message passing as a<br />means to call methods on objects. I had used messages before, but only<br />in Objective-C. I don't know if I was just doing it wrong, but message<br />passing in Objective-C basically amounted to normal functions calls with<br />a weird syntax, less compile-time checks, and named parameters.<br /><br />Message passing in Io was much more obviously potent. Message passing<br />in Io is clearly sending a chunk of data to an object which may (or may<br />not) result in the execution of a method at some point. For example, to<br />pass parameters in function calls in most languages, the callee<br />evaluates expressions in the parameters, pushes the arguments and return<br />address onto the stack, and jumps into the callee.<br /><br />This means that if you tried to write a function in C like<br /><br />return_type if(cond, then_code, else_code)<br /><br />That evaluated condition then returned one of the 2 branches, you would<br />have big problems with side-effects because both sides of the branch<br />would be executed before entering the if function. <br /><br />In Io, the code in both of those clauses is simply passed in as part of<br />the message arguments. The callee can check the condition then execute<br />the side that they wish to. This could be done in C by wrapping that<br />code up in some kinda of data like a function-pointer + context, but in<br />Io it's automatic. Similarly, message passing can trivially handle<br />things like co-routines and asynchronous, deferred, or delayed<br />invocation, because they very nicely bundle up that act of calling a<br />method.<br /><br />One annoyance is that there isn't much syntactical support for the<br />collections classes. They still offer all the expected features as well<br />as nice transformation operations like map and select, but it still<br />requires a little more imperative "add this to a list, then this, then<br />this" rather than really nice declarative collections processing.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-78915208393472237942011-05-08T20:28:00.000-07:002011-05-08T20:31:15.099-07:00Seven Languages: RubySince I finished my final projects for the semester, I've gone<br /> on quite a reading binge. One book I started working my way<br /> through is Seven Languages in Seven Weeks. This is a neat<br /> introduction to a slew of languages that focuses on their<br /> quirky, unique aspects. <br /> <br /> I think the list is Ruby, Io, Scala, Haskell, Prolog, Erlang, and<br /> Clojure, so their is a good mix of functional, declarative,<br /> object-oriented, and actor-based concurrency languages, as well as a<br /> good spread from static to dynamic. In fact, their may be a scatter<br /> plot in the making there.<br /> <br /> The book starts with Ruby. I believe Ruby is the easiest of the<br /> languages to learn, but I was still interested because I want to pick<br /> up CoffeeScript, which borrows much from it. I was really impressed<br /> with the interactions between blocks, the collections classes, and the<br /> IO system. <br /> <br /> Python supports some inkling of this, but I found the Ruby<br /> support much more fundamental to the language. I've always disliked<br /> writing for loops for the purposes of collections processing, and Ruby<br /> really does away with this. They also support ranges and slices in a<br /> much more unified way that Python<br /><br /> One thing I just saw a nibble of, but which interested me was the<br /> language-integrated support for Regex matching, ala Perl. While some<br /> of the implicit globals for string processing ($. is the line number of<br /> the last input read?) were a little gross, I thought this was really<br /> nice. I'd be interested to see how elegant a more general context-free<br /> grammar parsing framework could be. I couldn't find a way to run Ruby<br /> one-liners from the command-line, which is a pity because I've been<br /> looking for a reason not to learn awk, and this seemed promising.<br /><br /> I was a little thrown off by the highly dynamic nature of Ruby. Ruby<br /> supports things like open classes and overriding method_missing. These<br /> are really powerful, as Seven Languages mentions, for things like<br /> database adapters and XML frameworks, but making them efficient at<br /> runtime seems daunting. It seems like they would really defeat alot of<br /> JIT compilers, that try to do things like find consistent implicit<br /> class structures. Most code I write has fairly stern performance<br /> requirements, so I'm not sure it's the right language for me. <br /><br /> Next, on to Io!<br /><br /> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img.wowebook.com/images/1261249285.jpg"><img style="cursor:pointer; cursor:hand;width: 300px; height: 300px;" src="http://img.wowebook.com/images/1261249285.jpg" border="0" alt="" /></a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com2tag:blogger.com,1999:blog-3456596290636952173.post-21931621553807200922011-05-07T17:38:00.000-07:002011-05-07T17:51:51.788-07:00Clean Code ReviewToday I read most of <a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">Clean Code</a> by Bob Martin. The forward describes the book as being divided into 3 sections: guidelines, case studies, and "code smells" (negative heuristics). It also clearly cautions again reading sections 1 and 3 and skipping 2. Clearly, I went ahead and did just that. If that invalidates any of my review, so be it. I felt it was valuable nonetheless.<br /><br />One of this main tenets, which I find myself agreeing with, is that functions and classes should be small. And then they should be smaller. While it sounds silly, I think applied consistently and combined with great identifiers, it can make code really simple to read.<br /><br />For example, he recommends against nested scopes inside functions. This means that while, if, and fors should consist only of a single line, which is either a statement, or a function call. Great names for these functions leave little surprise about what they do, and the contents are basically what you would expect. <br /><br />This interplays nicely with the principle he espouses of only stepping down 1 level of abstraction in a function call. Each function can deal with a single responsibility by stepping down 1 level of abstraction and perform a few simple non-nested steps. Any more complication, or deeper layers of stepping, requiring extracting another function.<br /><br />One benefit of all this function extracting, which I hadn't thought of before, is that it is fruitful ground for extracting classes. Suppose you have a longish function that performs a sequence of steps on some local data. You extract those steps out into methods and make the local data instance variables. The original function now calls the extracted methods.<br /><br />However, you now have a little wad of instance data which is accessed only by a few methods. This is perfect ground for extracting a new class and moving those methods to it. I've used this a few times in my own code without really thinking about it, and been really pleased with the results.<br /><br />Overall it's really nice book, and a very fast read (especially if you skip the case studies). While the author is clearly a heavy Java developer, I still felt like I got good insight out of it, and I am definitely not a big Java guy.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://freebooksearch.net/pics/6fc7b_Programming_41znMZniZ1L.jpg"><img style="cursor:pointer; cursor:hand;width: 376px; height: 500px;" src="http://freeebooksearch.net/pics/6fc7b_Programming_41znMZniZ1L.jpg" border="0" alt="" /></a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com1tag:blogger.com,1999:blog-3456596290636952173.post-9229612591804086442011-05-02T12:29:00.000-07:002011-05-02T12:50:36.971-07:00The Passionate ProgrammerRecently I've been reading <a href="http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=passionate+programmer&x=0&y=0">The Passionate Programmer</a> by Chad Fowler. It's been a fast and entertaining read so far, and borrows a lot from Peopleware. It has a really interesting emphasis on personal and career development, rather than how to complete a project or task successfully.<br /><br />One point he drives is to really focus on your business value as a programmer. This means really being aware of how much you cost and how much value you produce. As a technical professional who loves what they do, it is really easy to become preoccupied with technical details and problems. However, this doesn't necessarily contribute to the bottom like or to the customer's/manager's perception of that contribution. <br /><br />Along with this is a call against technical elitism and specialization. "I'm only X and Y expert and it's not my job to handle Z" doesn't help you do your job, which is to solve those problems if they need to be solved. I feel like this extends not only to different technical areas but also to non-technical areas like responding to customers or understanding your business's finance. <br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href=http://www.globalnerdy.com/wordpress/wp-content/uploads/2009/08/the_passionate_programmer.jpg"><img style="cursor:pointer; cursor:hand;width: 152px; height: 228px;" src="http://imagery.pragprog.com/products/137/cfcar2.jpg?1298589825" border="0" alt="" /></a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-81131875898557116332011-04-30T17:57:00.001-07:002011-04-30T18:07:03.332-07:00Joy (and Lament) of Computer GraphicsSome of my vanilla Computer Science friends took classes in computer graphics this semester. Their reaction to the experience was enjoyable:<br /><br />"I could see what I was doing on the screen!"<br /><br />"People who didn't know what I was doing were impressed!"<br /><br />"I wrote it and then it was there!"<br /><br />I think this is one of the real joys of doing computer graphics; a deep satisfaction is seeing something (almost) tangible as a result of your efforts, and the instant appeal of great results.<br /><br />I think this is closely tied to some of the greatest challenges in your computer science: the difficulty of installing automated and repeatable tests in code, and in verifying that large amounts of numerical data are correct. It's very hard to assert specific facts about a graphics system in test code. For example, suppose you want to assert that some particular aliasing artifact doesn't appear. How would you without human eyeballs? Image differences? Machine learning/computer vision (recognize the bad patterns)? Spectral analysis (make sure some frequencies don't show up?) <br /><br />Similarly, it is much harder to verify the results of a large numerical computation than of a small logical one. Not only are the answers "fuzzier", there many, many, more of them. If you are lucky (as with matrix arithmetic) you could assert some large property about the numbers as a whole (maybe the matrix has a certain rank). If you are also lucky, maybe you could assert some point-wise fact (they are all positive). For anything in between, it's very difficult. Often, as anyone who has spent alot of time in Matlab knows, the best answer is plotting the data. This helps with the here-and-now, but doesn't solve the automated and persistent problem.<br /><br />I'm not sure what a good solution to this is, if there is one.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-159784196186441732011-04-25T12:33:00.000-07:002011-04-25T12:51:39.403-07:00Nested TabsSo I've been spending alot of time doing command-line development on my Ubuntu laptop recently, and I have <span style="font-weight:bold;">many</span> different ways to let different tasks share my limited screen-space. <br /><br />Recently however, I find I've been using them in a pretty consistent way, that help keeps all my work straight. Each level of indirection multiplexes screen-space across a specific direction. I thought I'd share my scheme here:<br /><br />Workspaces (change with Ctrl-Alt-(LEFT|RIGHT))<br />----Doc/Browser Programs (change with Alt-Tab)<br />--------Web Browser Tabs (change with Ctrl-Tab)<br />--------PDF Viewers (untabbed)<br />--------File Browsers<br />----Gnome Terminal (Generally only 1)<br />--------Terminal Tabs (use for different login sessions)<br />------------GNU Screen Windows (use for different working dirs)<br />----------------Vim Tabs (use for conceptually separate tasks in same dir)<br />--------------------Vim Split-Windows (use for one task that covers multiple files/different parts of the same file)<br /><br />The only level of nesting where I don't do much multiplexing is running multiple applications on the workspace I use for my Gnome Terminal, not sure if there is room for improvement there.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-19977821732632164392011-04-25T12:10:00.000-07:002011-04-25T12:20:25.306-07:00GTD + Todo.txtSo, I recently read <a href="http://www.amazon.com/Getting-Things-Done-Stress-Free-Productivity/dp/0142000280/ref=sr_1_1?ie=UTF8&qid=1303758705&sr=8-1">Getting Things Done</a>, and while I'm not sure all of it's points apply to me as a programmer*, I really liked the idea of capturing "open loops". You need to find all those little niggling things that you should be doing and capture them in a place you know where to look, so you can start thinking about what you should be doing, and just do it. <br /><br />This led me to looking for personal organization solid. I wanted something that would be sync-able across anywhere I use the internet, fast and efficient to edit, and preferably compatible with common formats in case I need to upgrade to a different program in the future. <br /><br />A few of the alternatives I considered were a plain TODO text-file, or Vim versions of Emacs Org-mode. After a little search however, I found Todo.txt, and I'm really happy with it. Todo.txt uses a plain text-file as it's central database, so it's about as compatible as you could hope for. It however also presents a filesystem like interface that allows efficient adding, listing, and completion, and will be instantly familiar to any Linux user. With the file-system interface, there is almost no friction to creating a new item, which is important for this system to work for me.<br /><br />Using Dropbox or normal line-based version control, Todo.txt can sync easily across multiple machines. They also provide a paid-for Android app that uses Dropbox, and is easily worth the $1.99 for the convenience. All in all, I think this is a really great and elegant solution.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-51619960890367483032011-04-23T15:45:00.001-07:002011-04-23T15:52:16.026-07:00Fun With HadoopSince I finally wrapped up the mail server, I've moved on to my next final project, our Wifi Heatmap. Part of the server side component of this application is a compilation step that clusters samples of network strengths into estimates of access point location, and then tiles those access points for efficient display. <br /><br />To make this a little exciting, I decided to use the Apache Hadoop framework to perform this computation in 2 Map-Reduce programs. The first map pass is trivial; it outputs the sample points keyed by the BSSID of the access point. The first Reduce pass is interesting, it is here that we cluster each set of samples with the same BSSID. In the second Map pass, we accomplish the bulk of the tiling by hashing each access points to its tile ID. In the second Reduce pass, we concatenate all access points with the same ID into a downloadable tile that we can then serve to our map viewer on demand.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-6277856600491372282011-04-05T12:06:00.000-07:002011-04-05T12:14:00.790-07:00SMTP Server and Unit TestsRecently, for Software Systems, I had a group project to build an SMTP and POP3 server and client. Milestone 1 was a simple single-machine implementation, Milestone 2 will be a clustered implementation. I was primarily responsible for the SMTP server.<br /><br />Moreso that most problems I have to solve, this was a really good chance to practice doing software development the "right" way. We had a clear protocol spec, separable parsing/formatting and protocol logic, and a need for configuration in terms of the backing store.<br /><br />One goal was that almost any line in the server should be runnable under unit tests. We accomplished this by programming almost entirely to simple interface, which let us make dumb mock implementations for test. This was especially valuable in testing the protocol logic, which with less care would have been connected to almost the entire rest of the system. Using a streamPair construct to replace sockets and a Session class to control a single user's connected session, we were even able to test full client-server interactions under unit tests with the overhead of only a single thread creation.<br /><br />Now that we move on to the clustered implementation, we'll encounter more testing problems in that our tests need to ensure correctness and consistency in a distributed system. We'll be moving to an automated test system that will run long-running multi-client, multi-server tests on every check-in, as opposed to our current system which runs units on every build.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-82458537195335783632011-02-22T09:46:00.000-08:002011-02-22T10:34:29.155-08:00GPU Programming Assignment 2I'm the teaching assistant for <a href="http://www.seas.upenn.edu/~cis565/">CIS 565: GPU Programming and Architecture</a> taught by <a href="http://www.seas.upenn.edu/~pcozzi/">Patrick Cozzi</a> this semester , and I'm handling the homework assignments this semester. CIS 565 covers both real-time graphics and GPU computing using CUDA. For the real-time graphics portion, we switched languages from Cg to GLSL this year, so I took the time to rewrite all the sample code using GLSL and proper OpenGL 3.3.<br /><br />The first programming assignment introduced students to basic shader programming. We had 3 different components, showing the students how to create a basic vertex shader, a basic fragment shader, and how to perform image processing in a shader.<br /><br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/DogE_5bSEco" frameborder="0" allowfullscreen></iframe><br /><br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/6ubgzYCwM-g" frameborder="0" allowfullscreen></iframe><br /><br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/a8K5wp8ilgc" frameborder="0" allowfullscreen></iframe><br /><br /><br />The second assignment had some more interesting problems. The first component had the students create a globe with many layered textured effects. This showed how artists can use textures to drive attributes behind basic color, and how layered effects can create complex visuals. The second component was a screen-space ambient occlusion algorithm. The main goals for this problem was to introduce the student to deferred lighting and rendering, and show them the effects and performance of different sampling schemes. Sampling is an important topic and applies to students in many different areas, such as graphics, vision, signal processing, and media encoding/decoding.<br /><br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/DIG9vhctMXY" frameborder="0" allowfullscreen></iframe><br /><br /><iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/Iv-Xj29NDMA" frameborder="0" allowfullscreen></iframe><br /><br />The homeworks can be viewed here: <a href="http://www.seas.upenn.edu/~cis565/Homework.htm">CIS 565 Homework</a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-15198843801205957102011-02-02T15:41:00.000-08:002011-02-02T16:11:41.838-08:00FactSnap!We recently competed at the PennApps Mobile development competition, with the same team as the last competition this fall. We didn't place in the competition, but I was really happy with the quality of our final product.<br /><br />The theme of our competition was 'serendipity'. Our application was a generalization of Snapple Facts for arbitrary products. Each product you scan will give you a random fact from a category specific to that product. <br /><br />Weuse Barcode Scanner to recognize barcodes and an online UPC database to look up the corresponding products. We built our fact database by scraping the Wikipedia Did-You-Know archives, and also display corresponding images scraped from Google search results. My girlfriend Lauren built the whole comic-book-themed front end and set up the image animation.<br /><br />Overall, it's a fun and cute little application that makes use of some neat technologies. Check out my demo video and a download link below.<br /><br /><a href="https://market.android.com/details?id=com.AnythingFacts">FactSnap! Market Page</a><br /><br /><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/940inJ_j0-o" frameborder="0" allowFullScreen></iframe>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-61581621857202845072011-02-02T15:26:00.001-08:002011-02-02T15:40:56.651-08:00Bank Conflict PredictionA fun final project I recently worked on for our Computer Architecture class here at Penn was a simulation of cache banking. Banking is a scheme to allow "multi-porting" of cache (or registers, or memory, etc.). True multi-porting, when a value can be read more than once in a given cycle, has great costs in terms of price, area, and latency. It requires additional transistors per data cell and doubles the read and data lines.<br /><br />Banking is a much cheaper scheme wherein the cache is divided into multiple static segments, which are interleaved by memory words. Simultaneous memory accesses to distinct static segments, called banks, can proceed simultaneously. However, if there is a structural hazard and multiple operations try to access the same bank at the same time, only one of them may proceed and the other has to be canceled and restarted. This problem is called a bank conflict. Generally, banked memories will have faster access latency than multiported memory, but there is the chance of a bank conflict. Even worse, certain access patterns, such as strided array access by a multiple of the number of banks, can lead to degenerate bank conflicts.<br /><br />Our group explored methods of bank conflict avoidance. In this scheme, at issue, we can predict that instructions will incur bank conflicts and delay them. This avoids a restart penalty and allows useful instructions to be issued in that slot. We used a number of predictors based on statistical properties of instructions and experience with way predictors and store-set predictors<br /><br />One difficulty of prediction is that the bank a memory operation will need to access is not determined until address computation. Our first practical predictor got around this by storing a table that predicts which bank a given PC will access. If a prospective memory operation is predicted to access a bank that another issued operation is predicted to access, we delay accessing the prospective instruction. This simple strategy was already fairly effective.<br /><br />Our best approach however was based on store-set technology. We simulated an idealistic and a realistic predictor. The idealistic predictor tracked the full set of all previous operations (by PC) with which each operation had conflicted. This can be thought of as building edges between PCs in a graph of conflicts. The idealistic predictor maintains sets of conflicting nodes via a compact union-find data structure. These can be thought of as connected components in the graph of conflicts. The realistic predictor actually gives better performance than the idealistic predictor, since it recognizes sets of conflicts. A good predictor for a 32kB-64kB L1 cache takes around 4kB.<br /><br />You can view the report below for more details and experimental data.<br /><br /><a href="https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B7xOhpK36sLAMGI5ZGEyNGQtMDQ5Zi00ZjQ4LWI0ZmItOTU2ZDM5NDg2MmUx&hl=en">Report on Bank Conflict Prediction</a>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-13012494902210744972010-09-30T11:04:00.000-07:002010-09-30T11:22:07.028-07:00Multithreaded Occlusion CullingOne of my personal projects was this optimized occlusion culling engine from Multicore Programming in Spring 2010. I worked on this project with Damon Rocco and Zachary Meister. Zach was the primary author of the paper, I wrote most of the rendering and parallelization code, and Damon took care of most of the geometric algorithms. Our results are detailed in a rather interesting paper found here: <a href="https://docs.google.com/fileview?id=0B7xOhpK36sLANWI3NjQ1Y2MtZDBiYy00NTAyLWFjYmItNTA0YmY0ZTY3ZThm&hl=en">Occlusion Culling Paper</a><br /><br />This project was interesting because it took a relatively small kernel of functionality, cell-portal culling and BVH culling, and focused intensely on optimizing out all bottlenecks. We attacked the problem on algorithmic, parallel, and micro-architectural fronts. <br /><br />We used Intel TBB Tasks as our basic method of breaking off units of work. Combined with a recursive formulation of the problem this gave us a natural and efficient way to decompose our parallel work. Tuning of our inner "work" loops also brought insight into the performance considerations of small loops, memory alignment, and vector arithmetic. Interestingly, we were also able to make algorithmic improvements by exploiting temporal coherence between consecutive frames. <br /><br />Besides the work discussed in the paper, I also took some effort to make the renderer efficient, which resulted in a roughly %50 speedup over a naive approach. Besides instancing of the models, we did an initial rendering pass that only drew depth. This enabled us to avoid unnecessary fill on pixels that would later be covered. In addition, to avoid unnecessary fill even earlier, we also performed a coarse depth-sort by dividing the world into octants and rendered front-to-back.<br /><br />A demonstration video of our work is embedded below:<br /><br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/nrw2kBsN_lw?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nrw2kBsN_lw?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-1900344259638686132010-09-30T10:51:00.000-07:002010-09-30T11:03:32.481-07:00PennApps 2010A very cool thing that happened recently was my team's victory at the <a href="http://www.pennapps.com/#2">PennApps</a> development competition. This was a 48-hour judged hack-a-thon with the goal of "improving the student experience". At the end of the competition, each team gave a 2-minute pitch and product demonstration showcasing their work, to a wide panel of guests and industry representatives. <br /><br />Our team, consisting of Lauren Frazier, Ryan Gormley, Sam Applebaum, and myself, developed a productivity app that allows students to print documents to our school's networked printers directly from an Android phone. This is very useful for printing the one-off bureacratic forms, homework assignments, and research papers that crop up in student life. <br /><br />Android's "Intent" notification systems allows us to print documents from anywhere on the phone, including mail, downloads, or filesystem; you don't need to launch a separate application. Because we use existing Linux command-line print functionality under the hood, the user doesn't need any special permissions or drivers to install the application. Use of OpenOffice on the backend allows us to print even Microsoft Office documents, as well as PDF's, images, and web pages.<br /><br />After our pitch and demonstration, our team won the $2500 Grand Prize. The application is available for free as SEASPrint on the Android market, and the source code is available at <a href="http://code.google.com/p/seasprint/">SEASPrint</a> under GPLv2.<br /><br />Below, I embedded a cute little promotional video our team put together:<br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/XMdmx-PEm4g?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XMdmx-PEm4g?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-58795463925518311312010-09-20T22:35:00.001-07:002010-09-20T22:47:26.912-07:00Dynamically Reloaded ShadersI first saw this technique from a brilliant engineer I worked with at LucasArts, Dominic Hamon. <br /><br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/i75trLVJM4I?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/i75trLVJM4I?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br /><br /><br />Shaders are small programs that describe the lighting calculations for a surface. Due to their small size and the diverse array of potential graphics hardware, shaders are usually compiled and targeted at run-time, rather than statically. Most software I've seen takes little advantage of that fact.<br /><br />Because shaders often have to be tuned to get exactly the right visual effect, many small changes occur during development. In addition, since step-through debugging and inspection of variable values usually isn't possible, one of the easiest ways to debug shaders is to visualize their calculations by outputting temporary values as surface color. Both of these lead to small frequent changes in shader files.<br /><br />Since most software I have used or developed simply loads the shader on launch, this means that each small change to a shader requires an application restart to refresh. However, because the shaders can be loaded and compiled dynamically, there is no reason that changes can't be detected and incorporated <span style="font-style:italic;">while the application is running.</span> <br /><br />My implementation of this uses Windows file change notifications to track source files. When a shader is created, all references to it are tracked, and its source files are added to a registry of tracked files. If a change notification is received for a tracked file, we reload it, recompile all shaders depending on it, and replace all references to the previous version with references to the new.<br /><br />My next plans for this include polishing the Windows interface (the guts are solid), implementing Mac and Linux version, and using this as a framework for the shader assignments in <a href="http://www.seas.upenn.edu/~cis665/">CIS 665</a>, a class I help teach on GPUs. I feel like this could substantially increase student productivity.Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0tag:blogger.com,1999:blog-3456596290636952173.post-83731041787561155052010-09-20T22:28:00.000-07:002010-10-14T07:12:53.038-07:00Interactive Rendering of Large Fluid SimulationsI thought I'd start off this blog with a link-back to my last blog, that I maintained for Senior Design at Penn. <br /><br />This project developed new techniques for visualizing large-scale fluid simulations using. We used a ray-casting technique to extract isosurfaces of a potential function, giving the surface its blob-by appearance. This technique is well suited to rendering particles simulations interpreted as fluids or gases. <br /><br />To accelerate this rendering, we perform each pixel in parallel and accelerate our ray collision queries using a spatial data structure. A grid data structure in perspective space makes traversal a very regular and efficient operation, and is well suited for uniformly distributed irregular data. To support dynamic simulations, we rebuild this data structure from scratch each frame.<br /><br />This project is currently stalled, but I may pick it back up in the next month.<br /><br /><a href="http://csgrendering.blogspot.com/?zx=a80978934d7d66af">Interactive Rendering of Large-Scale Fluid Simulations</a><br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/PUU5tzIJeZk?hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PUU5tzIJeZk?hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/4fg2VIrB7_A?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4fg2VIrB7_A?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>Anonymoushttp://www.blogger.com/profile/05609748900302690607noreply@blogger.com0