Saturday, September 27, 2008

Postmodern Math

Last Saturday I wanted to do something just for fun since we take Saturday’s as our Sabbath. Thinking about fun things to do (that are free since money is tight right now because car registrations came due this week) I decided I wanted to go to the library and get some books on math. This is something I do every once in a while, and we have been watching a lot of the show Numbers lately (Netflix is great) so my brain has been in a math mode.

We took Kati to the library for the first time, which we enjoyed much more than she did, and Kristen got some books on house design and scrapbooking. I brought home and armload of fun looking books about math and mathematicians.

The first book I ended up reading was Philosophy of Mathematics: an introduction to the world of proofs and pictures by James Robert Brown. C 1999 published by Routledge an imprint of the Taylor & Francis Group. ISBN 0-415-12275-9

This ended up being a fascinating general overview of the different strains of philosophy behind mathematics. I never realized there was so much debate among mathematicians about how to think about how math works.

There were several strains of thinking represented in the book but one debate that stood out was the question of whether mathematical concepts actually exist in some sort of platonic abstract realm of existence and mathematicians just discover these truths, or if mathematics is really just a social construct. The author believes in the platonic version of math and after reading the book I mostly agreed with him, but think he puts too much of a hard separation between the realm of math and the world we actually live in.

I found it particularly interesting to note that some of the extreme questioning of reality that has been connected with postmodernism has also made its way into mathematical philosophy. In particular chapter nine on how human’s follow “rules” especially when working from an existing sequence of numbers and seeking to extend them.

Suppose a teacher gives the following list of numbers to her student and asks them to extend the sequence (see page 133-134) 1, 4, 9, 16, …. “What is the next number? The student will likely answer 25. Why? Probably he will reason that the sequence obeys the rule of taking each number in turn and squaring it, i.e. 1 squared, 2 squared, 3 squared, 4 squared, and so on; the next number in the sequence would then be 5 squared which is 25.

But what if he answered 27? Would this be wrong? His reasoning might be as follows: The sequence is growing by adding successive odd prime numbers to the elements of the sequence. The odd primes are: 3, 5, 7, 11, 13, 17, …. Thus the sequence is:

1
4 = 1 + 3
9 = 4 + 5
16 = 9 + 7
.
.
.

And so the next number in the sequence is 16 + 11 which equals 27.”

Both of these are reasonable continuations of a mathematical sequence and the only sense in which one answer could be considered wrong has to do with the teachers “intentions” but are her intentions enough to justify considering one answer wrong?

The book goes on to give more extreme examples of a student following a rule to the best of his ability and getting an answer that is “obviously wrong” or is it? The answer given is absolutely not the one the teacher expected or intended, and would be considered wrong by most people, but is it really?

A mathematician named Kripke extended an argument by one named Wittgenstein on this topic to give the following set of arguments.

Causation is just regularity – nothing more; our inferences about the future are based on custom and habit – nothing more. Thus in this view:

  • · There is no fact of the matter about whether the teacher/questioner meant one sequence rather than another.
  • · The only way to solve the problem is to abandon the view that meaningful sentences purport to correspond to facts. Language does not word by being representational.
  • · However, this is not to abandon language. There are many useful things that various ‘language games’ can do.
  • · The conditions for the use of any language game involve reference to a community, all of whom play the same game.
  • · Ultimately, we act without hesitation, without justification; but this is not to act wrongly. In following a rule we simply do what we think is right. There is nothing deeper. But it is not enough to do merely what we think is right. ‘To think one is obeying a rule is not to obey a rule. Hence it is not possible to obey a rule “privately”; otherwise thinking one was obeying a rule would be the same thing as obeying it.
  • · We are trained by others, and we are judged to be following a rule correctly when we give the same answers as other members of the community. There is a strong tendency for all members of the community to give the same answers – a shared ‘form of life’. This is just a brute fact, like Hume’s regularities in nature. There is no explanation for this, no hidden cause: ‘What has to be accepted, the given, is – so one could say – forms of life.
  • · Our answers are (in some loose sense) in accord with the rule; but they are not caused by it. We do not grasp a rule which then determines our behavior; we do not agree in expanding a sequence because we share a common conception of some mathematical function. Rather, we say that we share a common conception because we agree in our answers, we agree in how we go on expanding the sequence.


The author of the book finds this conclusion “wholly absurd and thinks it ridiculous to say that it is only an amazing coincidence that we all agree in developing a sequence in the same way.” He concludes that “something is wrong with the premises of any argument that leads to this absurd outcome, and concludes that there are, after all, independently existing mathematical entities and we can grasp them, just as the Platonists have been claiming all along.” (Page 144-145)

I tend to agree with the author though I find Kripke’s argument to be challenging and I hate to link myself in any way with a Platonic view of the world. What do you think? Answer in the comments below.


Several times in the book, the author expressed what I would term a “negative view” toward religion, which I found to be interesting in a book on math. However I found his conclusion, especially coming from someone with this negative view of religion to be challenging.

“The real action today – the living philosophical issues for working mathematicians – cluster around visualization and experimentation. The clarification of this cluster of problems presents us with our greatest challenge. If our philosophical duty lies anywhere it is here, after the elimination of poverty which, of course, must be the first duty of all.”

How is it that a secular anti religious mathematician can view “the elimination of poverty” as “the first duty of all” and so many Christians can seem to view this issue as being unimportant compared to questions like “what style of worship is best?” Shouldn’t all Christians treat this issue as being at least one of our first duties?

Thursday, September 18, 2008

Image Upload Web Service in VB.NET

Image Upload Web Service in VB.NET


We are going to be doing and in house pictorial directory here at Chapel Hill this fall. I want this directory to be integrated with our website and allow us to view the directory pictures online.

The process as I envision it would include a family taking some time out of their Sunday or Wednesday night to have a picture taken. The photographer would take a family picture as well as individual pictures and transfer these to a computer. It would be ideal if the pictures transfered as they were being taken. We would then have a piece of software that would allow us to look up the info we have for this family, update it if needed, and upload pictures for the family and for each family member.

This software will need to re-size the images down from the hi-quality images taken by the camera to something that is a web appropriate size, upload the image, and update the family / individual profile to indicate which image belongs to them.

In order to do this, I needed a way to upload an image to a website using a VB program. I decided I would use a web service to do this and through some Google research I was able to put together a web service to do this.

Here is the code I used for the web service with a web form to test it out.
When I have finished the vb program I will post that code.

First the web service
-----------------------------------------------
Public Function UploadImage(ByVal imgdata() As Byte, ByVal FileName As String) As Integer
'Find the path on the server of our apps images folder
Dim FilePath As String = Server.MapPath("images")

'strip the path and .jpg etc out of our filename
Dim i As Integer = InStrRev(FileName, "\")
FileName = Mid(FileName, i)
Dim j As Integer = InStr(FileName, ".") - 1
Dim k As Integer = Len(FileName)
FileName = Mid(FileName, 1, j)

'Create a memory stream to hold the image data
Dim MS As New System.IO.MemoryStream(imgdata)

'Convert the memory stream to a bitmap image
Dim BM As New System.Drawing.Bitmap(Image.FromStream(MS))

'Convert the bitmap to a png and save it in our images folder
BM.Save(FilePath & FileName & ".png", Imaging.ImageFormat.Png)

'eventually we will create a database entry for this image and return the image ID
Return 1
End Function

---------------------------------------------------

Now the VB code for the web form
------------------------------------------------
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ws As New localhost.ImageUpload
Dim fs As Stream = FileUpload1.PostedFile.InputStream
Dim img(fs.Length) As Byte
fs.Read(img, 0, Convert.ToInt32(fs.Length))

ws.UploadImage(img, FileUpload1.PostedFile.FileName)
End Sub
End Class

---------------------------------------------------------

I hope someone finds this useful.

Tuesday, August 26, 2008

Buying a Server

I have been having problems with my website hosting company. I host 11 websites with hostonce.com and twice now all of these sites have been down for a couple days at a time, and the site for the company was down at the same time as well, so there was no way to submit a support ticket. After this happened the second time I decided I had to find a new hosting company. I wanted to be able to host all of my websites on one account with room to grow. I have 3 different accounts with hostonce since they offer a deal where you can upgrade to a 5 site host for 45 dollars above the 80 something price of one site. This was a good enough deal at first since I had locked in a yearly rate of 60 odd dollars plus the 45 for my first set of 5 sites, but over time it has proven to be a bit of a pain.

I looked into getting a dedicated server hosted for me, or ever a Virtual Private Server. The dedicated server setup would have cost over $4000 dollars a year, more than I can afford, and the VPS solution I found would have limited me to 30 websites and cost over $800 dollars a year.

Looking at those prices I began to wonder what it would cost to host my own webserver.
AT&T recently raised the price I was paying for internet from around $35 dollars a month to around $55 becuase we lost a discount we were getting.
Cox business internet service offers a plan with a dedicated IP and an OPEN port 80 for website hosting for $69 dollars a month. Not that much more than AT&T.
Dell offers a varity of servers for different price ranges. I found and ordered a very basic one on sale with a dual core 2.0ghz processor, two 80 gig hard drives, and 2gig of ram for $423.08 with taxes and Shipping. It should arrive next week.

Now I need to save up for the software to put on my server. Windows Web Server 2008 $469 Web Server-only product, no CALs required. Available in 32-bit and 64-bit versions. Fortunatly there is a 60 day downloadable trial version of this software (which I am downloading right now) so I can install and setup my software now and pay for it next month.

Fun, Fun, Fun, I have a new toy on the way.

Monday, August 4, 2008

Importing Data From Shelby Systems

Today I did most of the Spark, caught up on email, and did the following work on the new CHMS:

Worked on Creating the Ability to Import People and Families from Shelby, this included creating Data Access and BLL layers for the needed Shelby tables, and new methods in several of the BLL Classes along with some Data Access methods to go with them.

Fortunately, Shelby stored its data in a SQL Server database as well, so I was able to shutdown SQL server on our Server computer, make copies of the database files, re-start SQL server, bring the copied files to my computer, and attach them to my local SQL Server Express edition. Thus I can work with the Shelby database without having to connect to the actuall database on the server, and thus risk data, or kick other people out.

I may eventually work on a way to move updated data back and forth, but for now, getting data out of Shelby and into the new system is enough of a challenge.

Tuesday, July 29, 2008

AJAX

Today I finished up the bulletin for next Sunday and worked on the BLL and started the presentation layer for the Open Source Church Management System named Hill CHMS I am working on building for Chapel Hill.

I need to AJAX enable the site before I can go much further. I want admins to be able to start typing in a last name and have a list of choices appear below, with the list getting smaller as more letters are typed. I know this is possible with AJAX, I just don't know how hard it would be to actually do. If I can't do this right away I will settle for a list that populates when a button is hit.

I need to think of this in terms of versions, with version one just working and later versions having more features.

Monday, July 28, 2008

Today's Update

I know no one reads this, or really cares about the Church Management System I am working on at the moment. I suppose it is just my geekishness that makes me want to post all this here.

Today after getting all my other Church work done I worked on the CHMS and did the following"

Created tblContactMethods to hold of all things contact methods.
Created tblMembershipStatuses to hold membership statuses.
Created table adapters for these two tables.

I had forgotten to add these to the original database map, they connect the the people table

Changed tblPeople and re-created its table adapter.

I need to talk to George Retter, who is doing our Jump In - get people involved ministry here at Chapel Hill before I go any further.

Friday, July 25, 2008

More table images

Here are the images from some more tables for the CHMS