Wedding + 1

So yesterday I got married and today I’m blogging. What’s up with that?


Joyous Bridesmaids

We have our very own passive-aggressive matchmaker: the federal government..

Our preferred wedding date was August 8, 2008, in Lady of tdaxp’s hometown, when the Olympics come there. However, Lady of tdaxp’s student visa lasts only a year from her graduation, which is either August or December, depending on when her thesis is accepted. Worse, our lawyer inforemd us that an oversees wedding would involve approval by the State Department, who make the DHS look like a model of efficiency.

So that means that the Beijing ceremony will be a “reception,” and not the wedding itself.

So the question becomes: when will the American wedding be? This time Homelan Security steps forward, proudly doubling the fees for just about everything at the end of July. Compounded by the rule that the wedding has to happen before the application is begun, we now have an American wedding, an American reception, and a Chinese reception.

In the end, these adventures add to the awesomeness of yesterday. How many newlyweds get to here any of the following, let alone all three in only a few hours

  • “I never married anyone while wearing shorts before!
  • “I never opened a checking account on anyone’s wedding day before!
  • “I never heard a presentaiton on the speaker’s wedding day before!

Well, we did. We got an absolustely unique wedding. Yesterday was pure cool.

Today is too.

Linwood Wilson Out

Linwood Wilson, one of the Durham County thugs who helped Michael Byron Nifong and his co-conspirators (Crystal Gail Mangum, Jessee Jackson, the Group of 88, etc) try to get some youths raped in prison, has lost his job.

Fortunately, the villians are now stabbing each other in the back. Durham-in-Wonderland has video and text of Nifong criticizing Wilson.

For those new to the scandal, an enjoyable recap is available onYouTube.

Creating a Basic Question-List Interface

The presentaiton was a hit. The next step is to make the “take the experiment” feature less fakey, by incorporating pretests and posttests. My inspiration for how to do this comes from MediaLab, which I worked with previously.

Every Question will belong to a QuestionList. Every QuestionList can belong to any number of conditions. There will also be a model that ties QuestionLists into Conditions and one that ties QuestionOptions into Questions. The table schemes are something like :


Question
-ID
-Name
-Display
-Type
-ListID

-QuestionList
-ID
-Name
-Description

QuestionOptions
-ID
-QuestionID
-Name
-OptionText

QuestionListConditions
-ID
-ConditionID
-QuestionListID

ruby script/generate model question
ruby script/generate model question_list
ruby script/generate model question_option
ruby script/generate model question_list_condition

Then generate the appropriate models

Now to through the migrations, added fields as necessary

015_create_questions.rb

class CreateQuestions < ActiveRecord::Migration
def self.up
create_table :questions do |t|
t.column :name, :string
t.column :display, :text
t.column :type, :integer
t.column :list_id, :integer
end
end

def self.down
drop_table :questions
end
end

016_create_question_lists.rb

class CreateQuestionLists < ActiveRecord::Migration
def self.up
create_table :question_lists do |t|
t.column :name, :string
t.column :description, :text
end
end

def self.down
drop_table :question_lists
end
end

017_create_question_options.rb

class CreateQuestionOptions < ActiveRecord::Migration
def self.up
create_table :question_options do |t|
t.column :question_id, :integer
t.column :name, :string
t.column :optiontext, :text
end
end

def self.down
drop_table :question_options
end
end

018_create_question_list_conditions.rb

class CreateQuestionListConditions < ActiveRecord::Migration
def self.up
create_table :question_list_conditions do |t|
t.column :condition_id, :integer
t.column :question_list_id, :integer
end
end

def self.down
drop_table :question_list_conditions
end
end

Then rake db:migrate

Next, we’ll create the controller and the scaffold for questions and question_lists, as was done on day one.

ruby script/generate controller manage_questions
ruby script/generate controller manage_question_lists

Then generate the static scaffolds, like in day two.

ruby script/generate scaffold question manage_questions
ruby script/generate scaffold question_list manage_question_lists

Now create controllers for question_options and question_list_conditions. We are actually creating two classes of controllers here — the basic steps of setting up an experiment and the more mundane database-interface controllers. But more on that in a bit. For now:

ruby script/generate controller manage_question_options
ruby script/generate controller manage_question_list_conditions
ruby script/generate scaffold question_option manage_question_options
ruby script/generate scaffold question_list_condition manage_question_list_conditions

Now add the interface code as done two days ago to our four new controllers:

layout “notesonrails”

And modify /views/layouts/notesonrails.html as appriate. The goal is to provide access to every controller while differentiating controllers designed for use, for debugging, for output, and for the experiment itself:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title><%= controller.controller_name %>: <%= controller.action_name %></title>
<%= stylesheet_link_tag ‘scaffold’ %>
</head>
<body>

<p style="color: green"><%= flash[:notice] %></p>
<h1>Notes on Rails Admin Interface</h1>
<div id="menu_area">
<p>Create an Experiment:
<%= link_to ( "Experiments",
:controller => :manage_experiments, :action => :index ) %>,
<%= link_to ( "Conditions",
:controller => :manage_conditions,
:action => :index ) %>,
<%= link_to ( "Question Lists",
:controller => :manage_question_lists ) %>,
<%= link_to ( "Questions",
:controller => :manage_questions ) %>,
<%= link_to ( "Fields",
:controller => :manage_notes_fields ) %>,
<%= link_to ( "Records",
:controller => :manage_notes_records ) %>,
</p>

<p>Other Features:
<%= link_to ( "Notes",
:controller => :manage_notes ) %>,
<%= link_to ( "Students",
:controller => :manage_students ) %>,
<%= link_to ( "QuestionList Conditions",
:controller => :manage_question_list_conditions ) %>,
<%= link_to ( "Question Options",
:controller => :manage_question_options ) %> |
<%= link_to ( "Output",
:controller => :output ) %> |
<b><%= link_to ( "Take an Experiment!",
:controller => :students ) %></b></p>
</div>
<%= yield %>

</body>
</html>

Next up, alter the manage_question_lists controller so that one may pick several conditions for the question list to b belong too

in new(), add the line “@experiments = Experiment.find(:all)” and in _form.rhtml

Now let’s add some check boxes to the manage_question_lists controller so that we can associate it with our conditions

Firs,t let’s add some methods on question_list_condition.rb controller:

class QuestionListCondition < ActiveRecord::Base
def self.destroy_by_condition_id_question_list_id(condition_id,question_list_id)
to_destroy = find_by_condition_id_question_list_id(condition_id,question_list_id)

to_destroy.destroy if to_destroy
end

def self.add_by_condition_id_question_list_id(condition_id,question_list_id)
to_add = find_by_condition_id_question_list_id(condition_id,question_list_id)

if to_add
return to_add
else
to_add = QuestionListCondition.new(
:condition_id => condition_id,
:question_list_id => question_list_id
)
to_add.save
return to_add
end
end

def self.find_by_condition_id_question_list_id(condition_id,question_list_id)

to_return = find(
:first,
:conditions => {
:condition_id => condition_id,
:question_list_id => question_list_id
}
)

to_return
end
end

update four functions in manage_question_lists_controller.rb:

def new
@question_list = QuestionList.new
@experiments = Experiment.find(:all)
end

def create
@question_list = QuestionList.new(params[:question_list])
@result_of_save = @question_list.save

@question_list_conditions = params[:selected_condition]
for question_list_condition in @question_list_conditions
@question_list_condition_id = question_list_condition[0].to_i
@question_list_condition_show = question_list_condition[1].to_i
if @question_list_condition_show == 1
QuestionListCondition.add_by_condition_id_question_list_id(@question_list_condition_id,@question_list.id)
else
QuestionListCondition.destroy_by_condition_id_question_list_id(@question_list_condition_id,@question_list.id)
end
end

if @result_of_save
flash[:notice] = ‘QuestionList was successfully created.’
redirect_to :action => ‘list’
else
render :action => ‘new’
end

end

def edit
@question_list = QuestionList.find(params[:id])
@experiments = Experiment.find(:all)

end

def update
@question_list = QuestionList.find(params[:id])

@question_list_conditions = params[:selected_condition]
for question_list_condition in @question_list_conditions
@question_list_condition_id = question_list_condition[0].to_i
@question_list_condition_show = question_list_condition[1].to_i
if @question_list_condition_show == 1
QuestionListCondition.add_by_condition_id_question_list_id(@question_list_condition_id,@question_list.id)
else
QuestionListCondition.destroy_by_condition_id_question_list_id(@question_list_condition_id,@question_list.id)
end
end

if @question_list.update_attributes(params[:question_list])
flash[:notice] = ‘QuestionList was successfully updated.’
redirect_to :action => ‘show’, :id => @question_list
else
render :action => ‘edit’
end
end</i>

and then the _form.rhtml partial:

<i><%= error_messages_for ‘question_list’ %>

<!–[form:question_list]–>
<p><label for="question_list_name">Name</label><br/>
<%= text_field ‘question_list’, ‘name’ %></p>

<p><label for="question_list_description">Description</label><br/>
<%= text_area ‘question_list’, ‘description’, :rows=>4 %></p>

<p><label for="question_list_conditions">Conditions</label><br />
<% for experiment in @experiments %>
<p><%= experiment.name %>
<% @conditions = Condition.find_conditions_array(experiment.id) %>
<% for condition in @conditions %>
<br /><%= check_box :selected_condition, condition.id %>
<%= condition.name %>
<% end %></p>
<% end %>

<!–[eoform:question_list]–>

Excellent. To finish up today, just edit the administrative question_list_condition view, as right now it’s blank because it’s looking for content_columns, of which it has none:

—-

We won’t do everything for this scaffolding, but we will fix this list and make some code more portable.

In experiment.rb, change find_name_by_id to

def self.find_name_by_id(selected_id)
found_object = find(selected_id)
@to_return = found_object.name
end

now, copy and paste the same code into question_list.rb, while also adding

validates_presence_of :name, :description

to the top

Last, change list.rhtml to:

<h1>Listing question_list_conditions</h1>

<table>
<tr>
<th>ID</th>
<th>Condition</th>
<th>Question List</th>
</tr>
<% for question_list_condition in @question_list_conditions %>
<tr>
<td><%= question_list_condition.id %></td>
<td><%= Condition.find_name_by_id(question_list_condition.condition_id) %></td>
<td><%= QuestionList.find_name_by_id(question_list_condition.question_list_id) %></td>
</tr>
<% end %>
</table>

<%= link_to ‘Previous page’, { :page => @question_list_condition_pages.current.previous } if @question_list_condition_pages.current.previous %>
<%= link_to ‘Next page’, { :page => @question_list_condition_pages.current.next } if @question_list_condition_pages.current.next %>

<br />

<%= link_to ‘New question_list_condition’, :action => ‘new’ %>

Tomorrow: adding questions!

Christian Intellectual Death Squads

As a Catholic, I view the Protestant churches as essentially loyalty militias, forces that by-and-large assist the Christian correlation-of-forces but nonetheless escape any accountability from the earthly hierarchy. Thus, the Lutheran Church (Missouri Synod) is to the Holy See as the Badr Brigades are to the Republic of Iraq.

However, in this model there should be another category — death squads — of those who might be classified as loyalty militia except that the blowback from them is roughly as bad as the good they do. Death squads differ from other actors in that they are ideologically motivated and focus on the same concepts as the larger insurgency.

alpha_chi_ro_omega_md

The Seen and the Unseen

The most visible Christian ideological death squad is Islam, for obvious reasons. However, evangelical secularism or Ultracavlisnism, may form a Christian intellectual death-squad as well. Unqualified Reservations has more, courtesy of gnxp:

The “ultracalvinist hypothesis” is the proposition that the present-day belief system commonly called “progressive,” “multiculturalist,” “universalist,” “liberal,” “politically correct,” etc, is actually best considered as a sect of Christianity.

Specifically, ultracalvinism (which I have also described here and here) is the primary surviving descendant of the American mainline Protestant tradition, which has been the dominant belief system of the United States since its founding. It should be no surprise that it continues in this role, or that since the US’s victory in the last planetary war it has spread worldwide.

In fact, they are so unusual that most people don’t see ultracalvinism as Christian at all. For example, on the theological side, ultracalvinism is best known as Unitarian Universalism. (It’s an interesting exercise to try to find any conflicts between UUism and “political correctness.”) Ultracalvinists are perfectly free to be atheists, or believe in any God or gods – as long as they don’t adhere to any revealed tradition, which would make them “fundamentalists.” In general, ultracalvinists oppose revelation and consider their beliefs to be pure products of reason. And perhaps they are right in this – but I feel the claim should at least be investigated.

And when we look at the real-world beliefs of ultracalvinists, we see that ultracalvinism is anything but content-free. By my count, the ultracalvinist creed has four main points:

First, ultracalvinists believe in the universal brotherhood of man. As an Ideal (an undefined universal) this might be called Equality. (“All men and women are born equal.”) If we wanted to attach an “ism” to this, we could call it fraternalism.

Second, ultracalvinists believe in the futility of violence. The corresponding ideal is of course Peace. (“Violence only causes more violence.”) This is well-known as pacifism.

Third, ultracalvinists believe in the fair distribution of goods. The ideal is Social Justice, which is a fine name as long as we remember that it has nothing to do with justice in the dictionary sense of the word, that is, the accurate application of the law. (“From each according to his abilities, to each according to his needs.”) To avoid hot-button words, we will ride on a name and call this belief Rawlsianism.

Fourth, ultracalvinists believe in the managed society. The ideal is Community, and a community by definition is led by benevolent experts, or public servants. (“Public servants should be professional and socially responsible.”) After their counterparts east of the Himalaya, we can call this belief mandarism.

In fact, the four points are very common and easily recognizable tenets of Protestant Christianity, specifically in its Calvinist or Puritan strain. You can find them all over the place in the New Testament, and any subject of Oliver Cromwell’s saintly republic would have recognized them instantly. Rawlsianism is definitely the last of the four to develop, but even it is very common in the 17th century, when its adherents were known as Diggers – a name that, not surprisingly, was later reused. Ultracalvinism fits quite neatly in the English Dissenter and low church tradition. (Note the blatant POV of the latter page, with loaded words like “reform,” a good indication that Wikipedians incline to ultracalvinism.)

Ultracalvinism’s camouflage mechanism is easy to understand. If you are an ultracalvinist, you must dispute the claim that the four points are actually Christian, because you believe in them, and you believe they are justified by reason rather than faith. Therefore they are universal and no one can doubt them, whether Christian, Muslim or Jew.

What are the adaptive advantages of crypto-Christianity? Why did those Unitarians, or even “scientific socialists,” who downplayed their Christian roots, outcompete their peers?

Well, I think it’s pretty obvious, really. The combination of electoral democracy and “separation of church and state” is an almost perfect recipe for crypto-Christianity.

As I’ve said before, separation of church and state is a narrow-spectrum antibiotic. What you really need is separation of information and security. If you have a rule that says the state cannot be taken over by a church, a constant danger in any democracy for obvious reasons, the obvious mutation to circumvent this defense is for the church to find some plausible way of denying that it’s a church. Dropping theology is a no-brainer. Game over, you lose, and it serves you right for vaccinating against a nonfunctional surface protein.

Several intellegent and well spoken atheists, including Adam of The Metropolis Times, frequent this blog. I would love to hear their opinion