programing


import random
import time
i = round(random.randint(10,20)
j = 0
love = random.randint(0,1)
while(j < i):
	j = j + 1
	if(love == 1):
		print "loves me\n"
		love = 0
	else:
		print "loves me not\n"
		love = 1
time.sleep(1)

So Google is pushing their new android platform for mobile devices. I have downloaded the API but I haven’t had a chance to play with it yet. If the big G follows the pattern of the past it will probably be pretty easy to work with. I am pleased with this development. I have many reasons ($10,000,000us is not the least of them) one of the biggest is the fact that it is open source. I think having a project that is open to the community of developers is the best way of ensuring a good product. Essentially this gives a good chance that your product will play well with others, an idea shunned by many.

It has always seemed to me that by making your product only work with your other products that you are cutting yourself off from a valuable portion of market share. If you make your product the best, then allow EVERY one to use it than people will love you. If you tell people it’s the best then force them to use it they will resent you. Well actually a lot of people will follow your lead regardless. There will always be the few that are interested in their own way though.

(more…)

Thoughts on AI:

I have a hard time believing we will EVER be able to create a functional AI based on current technology and paradigms, at least according to the Turing test. The current method seems to consist of assigning probabilities to EVERYTHING. This will never fool a human. No human decides if the sprinklers were on based on the wetness of the grass. Correction: no human ACCURATELY determines this. see if you can spot the robot in this sample dialog:

speaker 1: the grass appears to be wet.

Speaker 2: It’s probably from the dew.

speaker 1: statistically speaking for this time of year there is only a .0123 percent chance that condensation would still be present on the grass at this time of day. Given the climate, the water bill, and past watering habits: it is far more likely that the sprinklers have been turned on at some point in the night.

speaker 2: Whatever.

(more…)

There is a book called ‘The Phantom Tollbooth‘ it’s one of those books that I read that redefined my personality. There was demon in that looked like le fils de l’homme only he actually didn’t have a face. He went on all the time about change being bad. This was also the book that made me love math and language. It was dark in places and demonstrated that just because you were a child you could still deal with tough decisions. Indeed it really emphasized that when you are a child your lack of experiance makes MANY things a tough decision.

The one thing that really stuck out in my mind though was a house with a door on each of its four walls. Each door was labled differently. There was ‘The Giant’, ‘The Midget’, ‘The Fat Man’ and ‘the Thin Man’ as you may have guessed each door was answered by the same perfectly average man. The reasoning was that from a thin perspective, he was fat, tall he was short etc.

We’ll be right back

    Which way is up? The natural inclanation is to think of everything above ones head as ‘up’. What of the people who are postiontioned 180° away from us on this spining ball of rock? It seems ‘up’ along with everything else is a matter of perspective.  What has made me think along these lines lately is the fact that I am working on a program to take the radial profile of an image. As a quick aside a radial profile is a method of sampling all of the pixels in an image radiating out in straight lines from the center of the image.

I was originally having some difficulty as I was thinking of it in that fashion.  How do you write a program to draw lines from the center of a square image and sample all the pixels, its near impossible.  Well it isn’t IF you change your perspective. I wish I was the one Who was responsible for the idea of the change but it wasn’t me.

The way it works is that you sample a pixel at a particular location (x,y), get the radial coordinate by taking the arctan of the coordinates of the pixel, compare that to your allowed bin values and you are done. Simple ONCE you have the perspective.

There has been a pretty pervasive theme to these entries lately. Almost all of them have had to do with programing.  Indeed they started with my stating I don’t like programing. This, as it turns out, was a lie.  The main reason I orginally became interested in programing is because it was the closest thing to magic to which I had access.  Now I have discovered the joy of physics and the further access to what would appear to be magic, it’s Arthur C. Clarke’s third law.

    I have often thought about making movies and writing stories and all the rest. It has led me to notice things in films that I had never picked up on before. What comes to mind is an ending scene in a movie where there are two characters standing next to one another each of them holding a cup of coffee. The cups of coffee (well probably tea considering the movie, and no I am not going to say what the film was so there =-þ) cause the viewer to connect the two in a much closer fashion than would ordinarily be the case. I thought it was interesting.

I would be upset by noticing things like this except I usually don’t unless I have seen the film several times.

The reason I was watching the film YET again is because I like having something in the background while I code and I have spent most of the day writing php. Not for homework as I should have been, nor was it for a job as would of been nice but just for myself which is the best of all. Evidently I do like to code. I am in the process of making a database driven wish list for me, my family, and my friends to use. I decided this way we wouldn’t have to keep doing the whole “what do you want for your birthday/holiday?” crap. It’ll be great. The things it needs are:

  • Individual user log ins
  • anonymous ‘purchased’ notification
  • easy item updating

and for the future:

  • Email notification for list updates
  • maybe an RSS feed instead of that

So far this whole thing has been kind of fun. It is enjoyable setting up the DB and the connections and learning about PHP and java script. These are all things I think I should have learned in school but we didn’t. All in all the programing curriculum at CSUCI is some what lacking.

So I am a computer science major, as such everyone expects me to love to program. Let me set things straight right now: I don’t. Well not really. I did enjoy writing a driver in perl that initiated a bunch of sorting algorithms and compared their times. I also like learning new languages I am currently working on learning a bit of Python. Python creeps me out because it does not use end of line characters, at least not that I have discovered yet.
example: printing Hello world!
perl:

print "\nhello world\n";

c:

main() { printf("\nhello world!\n"); }


python:


print '\nhello world\n'


GAA!! Notice the complete lack of semi-colon! As if this oft mis understood piece of punctuation hasn’t been trimmed from the english language enough now we must remove it from programing as well?! What will the future coders of America complain about?! Do you know how many hours of my life have been spent hunting for the missing semi-colon? or the misplaced semicolon? (interestingly enough demi, semi, and hemi can all mean the same thing),,, So I guess good riddance to the foul thing.

(more…)