Gradle, Lift, and Google App Engine

I’m getting back into the game a little bit, and I decided to take a look at Lift for web development. After an initially promising experience, I became totally unhappy with Eclipse (it began forgetting I had Google App Engine libraries on the classpath after every clean). So I moved back to the command line. The recommendation to use Simple Build Tool or Maven for Lift put me off: SBT is pretty weak for a build tool, and Maven is…well…Maven, off to download the Internet. So I went back to Gradle.

For the record, I’m using Objectify for my Google App Engine development, because JPA gets you into that whole ugly ORM conceptual space without need: there’s no “R” in GAE, so you might as well deal with it in a more natural way.

So, given that situation, I came up with this build.gradle script. (Forgive the ugly organization, but this is actually the relevant points extracted from a multi-project build.)

buildscript {
   repositories {
      mavenCentral()
      add(new org.apache.ivy.plugins.resolver.URLResolver()) {
          name = 'GitHub'
          addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
      }
  }
 
  dependencies {
    classpath "bmuschko:gradle-gae-plugin:$gaePluginVersion"
  }
}
 
apply plugin:'java'
 
// Buildscript dependencies and repositories
 
 
repositories {
  mavenCentral()
  mavenRepo name:'scala-releases', url:'http://scala-tools.org/repo-releases/'
  mavenRepo name:'objectify-appengine-releases', url:'http://objectify-appengine.googlecode.com/svn/maven'
  mavenRepo name:'sonatype-releases', url:'http://oss.sonatype.org/content/repositories/releases/'
  mavenRepo name:'sonatype-snapshots', url:'http://oss.sonatype.org/content/repositories/snapshots/'
 
  add(new org.apache.ivy.plugins.resolver.URLResolver()) {
      name = 'GitHub'
      addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
  }
}
 
// Universal dependencies
 
dependencies {
  compile "org.encog:encog-core:$encogVersion",
        "com.google.guava:guava:$guavaVersion",
        "commons-lang:commons-lang:$commonsLangVersion",
        "org.apache.commons:commons-lang3:$commonsLang3Version",
        "commons-io:commons-io:$commonsIoVersion",
        "commons-collections:commons-collections:$commonsCollectionsVersion",
        "org.slf4j:slf4j-api:$slf4jVersion",
        "org.slf4j:slf4j-simple:$slf4jVersion"
 
 
  testCompile "junit:junit:4.5"
}
 
// Now the Scala stuff
apply plugin: 'scala'
 
dependencies {
  scalaTools "org.scala-lang:scala-compiler:$scalaVersion",
       "org.scala-lang:scala-library:$scalaVersion"
 
   compile "org.scala-lang:scala-library:$scalaVersion"
 
  testCompile "org.scala-tools.testing:specs:1.6.1",
    "org.scala-lang:scala-compiler:$scalaVersion"
}
 
apply plugin:'war'
 
dependencies {
  compile "net.liftweb:lift-webkit_$scalaVersion:$liftVersion",
        "net.liftweb:lift-mapper_$scalaVersion:$liftVersion",
        "net.liftweb:lift-json_$scalaVersion:$liftVersion",
        "net.liftweb:lift-util_$scalaVersion:$liftVersion",
        "net.liftweb:lift-common_$scalaVersion:$liftVersion"
 
  testCompile 'org.mortbay.jetty:jetty-util:6.1.22',
          'org.mortbay.jetty:jetty-management:6.1.22'
 
  providedCompile 'javax.servlet:servlet-api:2.5'
}
 
apply plugin: 'gae'
 
dependencies {
    compile "com.googlecode.objectify:objectify:$objectifyVersion"
    gaeSdk "com.google.appengine:appengine-java-sdk:$gaeVersion"
}
 
gae {
  downloadSdk = true
  disableUpdateCheck = true // Error with HTTPS
 
  appcfg {
    email = 'smokejumperit@gmail.com'
    logs {
      append = true
      severity = 1
      ouputFile = file('build/logs.txt')
    }
  }
}

I stash versions in the gradle.properties file, which looks like this (it’s a lot more details than you actually need):

scalaVersion = 2.9.1
liftVersion = 2.4-RC1
gaePluginVersion = 0.5.2
objectifyVersion = 4.0a2
guavaVersion = 11.0.1
commonsLang3Version = 3.1
commonsLangVersion = 2.6
commonsIoVersion = 2.1
commonsCollectionsVersion = 3.2.1
encogVersion = 3.1.0-SNAPSHOT
androidPluginVersion = 1.1.0
slf4jVersion = 1.6.4
gaeVersion = 1.6.1

If you start Lift up at this point (using gradle gaeRun), there are errors about Lift not having permission to mess with the thread pool.

Now, here’s the amazing magic trick which I found documented nowhere but discovered while digging through the Lift source code. It’s an astounding and miraculous trick which is necessary in order to get Lift to work on Google App Engine.

In the file ./src/main/resources/props/default.props, make sure to have this set:

inGAE=true

That’s it. You do that, Google App Engine works. You don’t do that, it won’t. Magic!

Posted in Gradle, Scala | Tagged , , , , , , | Leave a comment

Back Again to There: A Nontheistic Statement of Faithiness

[Editor's Note: This is a follow-up to There and Back Again. If you haven't read that post, start there (including the comments) and then come back.]

I finally figured out what was bothering me. While driving to the Science Online 2012 open mic night and listening to Jon Watts’ Lifted Up, I suddenly had an epiphany. Suddenly, things made sense. And it all came back to a mathematical formalism.

The formalism is the disproof by contradiction. That formalism can be colloquially expressed this way: if assuming X leads to a conclusion of not-X, then not-X is true. In this case, the specific expression is as follows: assuming rationality forms the foundation of lifestyle and morality, I have found rationality cannot form the foundation of lifestyle and morality. Therefore, rationality cannot form the foundation of lifestyle and morality.

This is a radical transformation. It is much more radical than anything else I have encountered, because it dislodges and renders impotent any question about why an action should take. This is fundamentally different than the ethical/lifestyle systems proposed to me, and it is easy to see why once you spell them out.

  • Enlightened hedonism, for instance, might claim that they are acting on this philosophy, because they are optimizing the phenomenologically self-justifying good of pleasure. Humanism or utilitarianism, insofar as they might justify themselves through enlightened hedonism, are also founded on this argument. Yet the self-justifying good of pleasure is a course that has to be maximized, and therefore there are better and worse ways of being in the world, and rationality is presumed to be critical in determining which ways are better and which ways are worse.
  • My position is actually more skeptical than the skeptics. The skeptics presume that one should live based on rational claims and oppose non-rational claims. Yet rationality itself is self-defeating, and so does not stand up to the skeptic’s own standards. (Skeptics refusing to apply their own standards to themselves is a recurring problem I have with skepticism as a community, BTW: a case in point.)
  • I don’t know much about Buddhism, but my understanding is that its core teaching is that attachment is the source of suffering, and so the goal is to not be attached to outcomes. If that’s true, than in a way, I’m more Buddhist than the Buddhists, because I’m also not attached to not being attached. (And I must admit, I do feel like I have reached a sense of Enlightenment.)

My new standpoint is the ultimate “Fuck it, let’s go bowling.” philosophy, and so I have adopted the Dude’s answer as a hyper-absurdist effort to counteract the rationalist trap. As soon as you engage a rational argument, you’re playing that ultimately self-defeating game again. Yet what is true or not true does not matter, not because of any statement about the value of truth or nihilism, but because fuck it, let’s go bowling. Why I believe something or act a certain way is not a question I have to answer, because fuck it, let’s go bowling. I’m not optimizing my happiness. I’m not striving towards an ethical life. I’m not playing into a grand narrative. I’m fuck it, let’s go bowling.

When I realized this — when I realized that my nagging issue with rationality leading to irrationality was that it proved rationality was false, and when I really realized how deep the denial of rationality went, then suddenly I was free. I saw the world differently in a moment. It was astounding.

Now, some of you may be saying, “Took you long enough.” There are a lot of people out there who have criticized me for thinking too much. I couldn’t just let stuff go, however, as long as there seemed to be compelling ethical mandates—or even the promise of compelling ethical mandates just under the next book cover. But that effort has not only yielded nothing, but actually outright self-destructed. Now I’m free of the mandate; that’s what it would take, and it finally go there: rationality is self-defeating.

(BTW, I should note that “Fuck it, let’s go bowling” is actually Walter’s line, not the Dude’s, but it so perfectly sums up the philosophy that I’m sticking to it. And besides, fuck it, let’s go bowling.)

(Also BTW, if you’d like to prove to me that rationality can form the foundation of lifestyle and morality, you’re welcome to try in the comments. Start by listing off all your presumptions. I’ll even give you Cogito, ergo sum for free, although you have to presume or argue any nouns you’d like to drive from those verbs. Also, please keep in mind that Hume pretty well destroyed inductive reasoning, so arguments from science are first going to have to undo Hume.)

Posted in Metacognition | Tagged , , , , , , , , | 26 Comments

There and Back Again: A Journey Into and Out of Faith

The gods forgot that they made me
So I forget them, too
I dance among their shadows
I play among their graves

(David Bowie, “Seven”)

Science tells us we are merely beasts, but we don’t feel like that. We feel like angels trapped inside the bodies of beasts, forever craving transcendence.
(VS Ramachandran, cognitive neuroscientist)

For the last few years, I have been a seminary student. Although hardly “evangelical”, I entered seminary with a strong faith in a benevolent God that I attached to Christianity. During my time in seminary, my experience with the Society of Friends (Quakers) and my (notably extracurricular) reading of Leo Tolstoy’s presentation of Christianity strengthened my faith quite a bit. I believed that an incarnated God had laid out a proper mode of life and that the right focus for life was transformation into the unsullied image of that incarnated God. It was a standpoint that I was very comfortable with and very excited by, and it shaped how I made decisions and where I placed value. For more on those beliefs, see my other blog and my Ask a Quaker guest post on Rachel Held Evans’ blog.

At the end of last semester, however, that all collapsed, and I am left as a kind of weak atheist. The post mortem of my faith is a complicated narrative: there is no simple cause of death. Many people who leave seminary as weak atheists (including Bart Ehrman, who teaches at The Other School), entered as evangelicals or fundamentalists. When their self-authorizing and monolithic interpretation of the Bible is pummeled to dust and the faux-rational Christianity is revealed to be a mess of paradox, their faith becomes shaken and they end up leaving seminary as atheist-materialists, often with the same evangelical zeal for atheist materialism that they had for Christianity. Although that’s a common story, it’s not mine.

My Christianity has not been fundamentalist or evangelical: instead, it has been an on-again/off-again relationship. I became an ardent atheist as a teenager, even self-identifying as a LaVeyan Satanist at times. This came from recognizing only two kinds of Christianity as a child: a kind of weak Protestant liberalism on the one hand, and a kind of overbearing Protestant fundamentalism on the other. The first did not seem to actually require anything distinctly Christian, and the latter did not seem to actually engage reality. Yet even in my most atheistic of moments, I had a sense of spirituality—a sense that the modern narrative of the utterly isolated individual was somehow wrong, and that the union of individuals was holistic and synergistic. In college, I encountered a moderate liberal Christianity in the “neo-orthodox” vein. Its arguments convinced me: Christianity taught a proper ordering of the individual, which is truly to be in a properly ordered community.

Despite neo-orthodox teachings, though, simply going to church and doing the nonproductive repetition of the liturgy didn’t seem to satisfy that spiritual aspect. I joined Freemasonry (eventually becoming 32nd degree in the Scottish Rite) and continued to study esoterica, including the (publicly accessible) teachings of the A∴A∴. At this point, my Christianity began to wane into a kind of Calvinist-flavored deism. That’s when things suddenly changed.

Up to this point, I never had a real sense of relationship with God. Prayer had never established a “relationship” with God, except in the kind of one-sided relationship that I have with my favorite TV or book characters. (Sarah Howell has an excellent blog post called “Prayer Doesn’t Work“, and it sounds exactly like my thoughts on the matter…but with more apparent faith remaining.) For some reason, however, I suddenly had a sense of “calling”. This was not the kind of “calling” that comes from careful reasoned thought and the recommendations of others: this was a strong sense that something beyond me was calling me into seminary. It was a profound and constant pull, and it did not seem to originate from within me nor did it seem to be under my control. The feeling was amazing and profound, and after some time I had no choice but to relent to the calling—it was that powerful.

I moved to Durham and started attending seminary. While there, my faith was transformed but did not weaken. Without a doubt, however, I was challenged. There were a number of things I had taken on faith because it was where “all scholars agreed”. These points, however, were rapidly removed as I discovered just how little agreement there is among scholars, and how artificial the points of agreement are: in theology, there are certain axiomatic claims that are required in order to be a part of the conversation (e.g. get published in a particular journal), and these axiomatic claims then become the points of seeming universal agreement. Similarly, I discovered just how contextual and utterly Western the creeds are, which reduced my respect for them down to effectively nil. That wasn’t the hardest blow, though.

Most damaging, however, was discovering just how interested the church was (and is!) in reifying and reinforcing boundaries between people-groups—a horror especially when contrasted with the church’s relative disinterest in helping the poor and actually behaving like Jesus taught. This was a major problem for me, because the core assertion of neo-orthodoxy is that the church somehow contained and embodied the right interpretation of Jesus’s teachings. Yet the practices of the church (both historically and presently) and the places where the church spends its time are so utterly different from the model of Jesus that I could no longer trust in the tradition of the church. In the history of the church, the truly holy—even those obviously aspiring to be truly holy—seemed to be the rare and precious exception, not the norm. How could I trust that institution to teach and transform me into holiness if it consistently failed to do so for everyone else?

At the same time as I encountered these struggles, I encountered the tradition that I draw from Gandhi’s Christian followers (e.g. J.C. Kumarappa), Martin Luther King, Jr., Leo Tolstoy (esp. What I Believe), Christian agrarianism, and the early Quakers. These people had an alternative take on Christianity focused on the Sermon on the Mount. It was a spiritually and socially conscious Christianity, and it seemed to be the true tradition of Jesus. This became the Christianity that I identified with, although I eventually quietly dropped the active use of the “Christian” label because of flak from Christians who thought I didn’t meet the minimum requirements for it. That fight rapidly became exhausting, and the benefits of keeping the label were rapidly offset by the annoyingly constant challenges.

The end of my faith, however, came through the study of cognitive science, and especially the cognitive science of religion. Through all of this, my faith was backed up by that sense of calling. No matter what else happened, no matter how else I made sense of reality, I had to account for this experience of being moved by something beyond myself. However, through studying cognitive science, I discovered an entirely reasonable explanation. From David Eagleman’s Incognito (and reinforced by VS Ramachandran’s The Tell-Tale Brain), I learned that the mind can experience an emergent subconscious as being an utterly alien presence.

The clincher, however, came when I read Harvey Whitehouse’s Modes of Religiosity. In there, Whitehouse lays out (with strong empirical evidence) how the ideas contained within repetitious and ritualized practices become “sleeper agents” in the brain, surfacing to make sense of strange or disquieting experience. This expression of the practices’ ideas are experienced/interpreted as spontaneous expressions of divine presence or ordering.

This was, in short, exactly what I experienced. My only experience of the divine now had an entirely this-worldly explanation. Without that support column, my faith rapidly crumbled. My Tolstoy-Quaker religiosity was all stipulated on the existence of God, and I no longer have any basis to believe in the Christian God. Although some are more than happy to be a part of a religious community that affirms something they don’t actually believe in, I am not. I am still processing my relationship to Quakerism, but in terms of my relationship to Christianity, I’m out.

Now, at this point in atheist conversion narratives, people sometimes start to talk about how free they felt and how great it is that they were no longer shackled by the expectations of their faith community. This is definitely not my experience. At the end of the day, I am a child of the Enlightenment: I have a commitment to rationality and to living my life in a rational way. All systems of rationality, however, need their axioms. Nietzsche and the existentialists showed that there is no intrinsic value in the world, but Christianity was a counter to this nihilism, providing a set of axioms and a guiding methodology for life. Without Christianity, I am back to the world of nihilism. Rationality no longer has a foothold by which to guide life.

Asking around, the only advice I find from atheists is to “do what you want”, but what should I want? Like all humans, my desires are utterly mutable—the very existence of marketing and psychotherapy is because of this fact. (Not to mention operant conditioning! I’m reminded of The Big Bang Theory on this point.) If I don’t take control of my desires’ mutations, I am simply submitting yourself to the vicissitudes of corporate marketing departments and political spin-meisters. Like the Machines in The Matrix, politics and capitalism are constantly consuming humanity and feeding us illusions. Evidence suggests that playing into their illusion is a path to a life of quiet despair, yet with no values, there is no guide about what desires actually are good or bad to pursue. Satisfaction and reward are both stipulated on accomplishment, which itself presumes a set of values.

Worst of all, though, this idea that you should “do what you want” seems like it is an utterly un-rational punchline to an extensive pro-rational argument. Be rational and doubt everything. Be rational and be a skeptic. Be rational and seek the truth. But once you do all of that, forget being rational, because it can’t help you anymore. I was happier and more satisfied as a Christian: it was a sick trick to lure me out of that joyful place with rationality, just to drop me in a place of nihilistic disillusionment and then tell me I should abandon rationality and seek a joyful place.

This frustration is compounded by the fact that I have little in common with evangelical atheism and its promissory materialism. I find most self-proclaimed skeptics to be annoyingly un-skeptical, but instead committed to their own particular materialist dogmas (e.g. Michael Shermer, as I discuss in this book review). The problem of qualia still prevents me from buying that the only thing that exists is the “physical world” as science constitutes it, or from taking the only philosophically defensible materialist stance—namely, that subjectivity doesn’t exist (e.g. Daniel Dennett, as I discuss in this book review). I am inclined towards John Searle’s “biological naturalism” conception of consciousness, but it’d be nice if we had any idea how physical material could produce whatever it is that qualia are. The question of “the mind’s eye” (which some people don’t have!) might be an interesting angle of attack, since it puts the question in sharp focus…

Since subjectivity exists, I still have space for a kind of hollow “spirituality”. Surprisingly, little has changed on that front: God is now absent, but God was never particularly present before, despite my earnest desires. Since the Bible drops out with Christianity, my interpretation and expression of spirituality is now more purely phenomenological rather than theological. The existence of mirror neurons and the human ability to have a theory of mind means that I am still able to have an intersubjective spirituality, as well. This has actually sharpened my interest in the spirituality of sexuality, which has been a long-running interest of mine.

Right now, I am struggling to re-situate myself. I am haunted by Camus’ question: “In a world without God, why not commit suicide?” (For his answer, see here.) I am reconsidering all of the projects, dreams, and relationships that I used to have, trying to see if they can still retain some kind of joy and impetus in the face of my epic disillusionment. I have continued on with the projects which are hold-overs from before the disillusionment, trying to retain some kind of momentum. But ultimately, I now live in a world which feels flat, and I am living a life without direction. Thanks a lot, Rationality.

[Editor's Note: This post has a follow-up at Back Again to There.]

Posted in Metacognition | Tagged , , , , , , , , , , , , , , , , | 17 Comments

My Introduction to ScienceOnline (#scio12)

This upcoming weekend, I will be attending ScienceOnline 2012. For years, I’d heard whisperings about the science conference that Duke’s own “Mister Sugar” helped organize, but my interest was never quite piqued enough to attend. This year, I heard AV Flox and Jason Goldman were coming, and that was enough to push me overboard. Since following it, I’ve gotten really excited: from the science of tattoos (and tattoos of science) to The Monti storytelling to questions about open data, it should really be a fascinating time. The Twitter community alone (follow @scio12) has been great, so getting to meet these people face-to-face should be even better.

One of the things to do is to introduce yourself on your blog, so here goes.

Although my background spans mathematics, computer science, and software development, my most recent movement has been into a seminary. I have spent the last thee years chasing after the Big Questions at Duke Divinity School. During this time, I have became entranced by the intersection of mind, the brain, the body, and society: it began with a paper asking, “What does it mean to have pets?”, which led me to read about the psychological and physiological transformation in canine domestication (as mirrored in the Siberian Fox experiment). Ever since, I have been pursuing the scientific and philosophical treatments of cognitive science, especially cognitive neuroscience and neuroeconomics. I’m particularly interested in the relationship between cognition (especially decision-making) and social engagement, as well as in experiences of empathy and mirror neurons. Sexuality and religiosity/spirituality are two especially interesting influences within that scope. I have submitted my application to do doctoral work in cognitive neuroscience, and hope to enroll in a program this Fall.

Posted in ScienceOnline | Tagged , , , , , , | Leave a comment

OS-X: Using Tor for All HTTPS Connections

I am a big fan of Tor, especially as the Great Firewall of America is going up. I previously posted instructions on how to set up Tor on OS-X, and I wanted to update that guide a bit.

One of the problems with Tor is that the entry nodes and exit nodes can see your raw traffic. This is just the nature of the beast: sooner or later, someone is going to see everything. And it’s still better than the entire internet seeing your raw traffic and having it mapped directly back to your IP address, which is the default mode on the internet.

HTTPS, for all its flaws, basically solves this problem. It provides the encryption necessary to obscure traffic going over Tor. So the common advice was to be cognizant of whether you were going over HTTP or HTTPS and to never transmit any personally identifying information over HTTP, because that would compromise your Tor anonymity. This is, suffice it to say, tricky.

While poking around my Network Settings on OS-X, I discovered something interesting: you can specify per-protocol proxies. So, instead of using a blanket proxy for my web browser, I now simply set my system to use an HTTPS proxy. Problem solved. HTTP traffic goes directly over the Internet, and HTTPS traffic goes over Tor. In theory, someone could correlate my HTTP and HTTPS traffic if a website uses both (e.g. serving up static content over HTTP, dynamic over HTTPS), but that’s both unlikely and not really my concern. If I want total anonymity at the cost of routing HTTP over Tor, I’ll fire up Firefox and click my Torbutton.

Similarly, I can set up just a SOCKS proxy, so anything that speaks at that low of a level can route its traffic through Tor.

The way to do this is to hop into System Preferences > Network > Advanced… > Proxies. Click on Secure Web Proxy (HTTPS) and set the server to localhost and the port (the part after the colon) as 8118. Then click on SOCKS Proxy and set the server to localhost and the port (the part after the colon) as 9050. You have to click Advanced... for each interface that you want to route over Tor.

Enjoy!

Posted in Software Business | Tagged , , , , | Leave a comment
  • Categories