Friday, May 30th, 2008
Slowly but surely, the Terminal App is gaining functionality. I feel like a lout with it just sitting there doing nothing, but what the hell else should I do? Learn how to use it? Pssh, in my dreams. Anyway, you can now access a list of the distances of some celestial bodies, which you can then use to depress yourself with the Cosmic Trip Program.
For those made savvy by yesterday:
65, 32, 84, 114, 101, 97, 115, 117, 114, 101, 32, 104, 117, 110, 116, 63
Posted in Code | Comments Off
Thursday, May 29th, 2008
73, 32, 102, 105, 110, 97, 108, 108, 121, 32, 102, 105, 110, 105, 115, 104, 101, 100, 32, 97, 110, 111, 116, 104, 101, 114, 32, 74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 98, 117, 105, 108, 100, 32, 111, 102, 32, 111, 110, 101, 32, 111, 102, 32, 109, 121, 32, 111, 108, 100, 32, 80, 121, 116, 104, 111, 110, 32, 112, 114, 111, 103, 114, 97, 109, 115, 46, 32, 84, 104, 101, 32, 74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 67, 105, 112, 104, 101, 114, 105, 122, 101, 114, 32, 105, 115, 32, 117, 112, 32, 97, 110, 32, 114, 117, 110, 110, 105, 110, 103, 46, 32, 78, 111, 119, 32, 121, 111, 117, 32, 99, 97, 110, 32, 101, 110, 99, 111, 100, 101, 32, 97, 110, 100, 32, 100, 101, 99, 111, 100, 101, 32, 115, 101, 99, 114, 101, 116, 32, 109, 101, 115, 115, 97, 103, 101, 115, 32, 102, 114, 111, 109, 32, 121, 111, 117, 114, 32, 102, 114, 105, 101, 110, 100, 115, 32, 97, 110, 100, 32, 101, 110, 101, 109, 105, 101, 115, 46, 32, 85, 110, 102, 111, 114, 116, 117, 110, 97, 116, 101, 108, 121, 32, 105, 115, 32, 105, 115, 32, 101, 97, 115, 105, 101, 114, 32, 116, 111, 32, 99, 114, 97, 99, 107, 32, 116, 104, 97, 110, 32, 116, 104, 101, 32, 80, 121, 116, 104, 111, 110, 32, 118, 101, 114, 115, 105, 111, 110, 44, 32, 97, 115, 32, 116, 104, 101, 114, 101, 32, 119, 97, 115, 32, 97, 110, 32, 101, 108, 101, 109, 101, 110, 116, 32, 111, 114, 32, 116, 119, 111, 32, 116, 104, 97, 116, 32, 73, 32, 104, 97, 118, 101, 32, 98, 101, 101, 110, 32, 117, 110, 97, 98, 108, 101, 32, 116, 111, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 32, 97, 112, 112, 108, 121, 32, 105, 110, 32, 116, 104, 101, 32, 74, 97, 118, 97, 83, 99, 114, 105, 112, 116, 32, 98, 117, 105, 108, 100, 32, 111, 102, 32, 116, 104, 101, 32, 112, 114, 111, 103, 114, 97, 109, 46, 32, 66, 117, 116, 32, 105, 116, 32, 119, 111, 114, 107, 115, 32, 97, 115, 32, 105, 116, 32, 115, 104, 111, 117, 108, 100, 44, 32, 97, 110, 100, 32, 105, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 100, 32, 116, 111, 32, 112, 114, 111, 118, 105, 100, 101, 32, 108, 105, 116, 101, 114, 97, 108, 108, 121, 32, 109, 111, 109, 101, 110, 116, 115, 32, 111, 102, 32, 102, 117, 110, 32, 102, 111, 114, 32, 121, 111, 117, 32, 97, 110, 100, 32, 111, 110, 101, 32, 111, 116, 104, 101, 114, 32, 112, 101, 114, 115, 111, 110, 46
Posted in Code, euler | Comments Off
Thursday, May 22nd, 2008
After over a week, I have finally come up with a solution to Project Euler #3. In which I was asked to find the largest prime factor of the number 600851475143. This was a particularly nasty little bugger that gave me all sorts of hell. It took me a while in the first place to come up with an algorithm to figure primes. I thought I was sitting pretty when I got that working, but the number they give was too big to compute with brute force, so I had to come up with a way to chop it down a bit. The solution, as you can see, is pretty messy, and I barely have a grasp on how it even works. The print out is also really quite gross, so you have to know what you’re even looking for, but it works. I’ve got my answer. I can sleep through my nights once more.
I’ve also managed to plow through another problem involving Primes that I had passed over, Problem 7, which by comparison seemed pretty meager simply asking me to find the 10001st Prime. No problem. Just takes a while to compute.
Posted in Code, euler | Comments Off
Wednesday, May 21st, 2008
I tried to explain that I am lousy with math, but it seemed like my head was on straight enough. However the worst of all possible nightmarishly ironic situations has occurred: my math describing how bad my math is has turned out to be incorrect. So, as a formal retraction to my claim that my solution to Project Euler #9 goes through !3000 iterations to produce it’s results, I must announce that it does not. My buddy Carl tipped me off to the fact, of which I am logically aware, but chose to ignore since the thrill of stupidly large numbers was at stake, that !3000 is a number larger than the count of atoms in the universe, or grains of sand on all the World’s beaches. The correct total of iterations for this particular program is more sensible: 1,000,000,000. Which I guess is large enough, but it sure aint no !3000. However, I do trust that my skills are slowly getting less bad. It has been at least seven years since I have done any real and consistent crunching of numbers (I went to Art School remember), and it is a disappointment, but no surprise that is taking me some time to get back into the swing of things.
Posted in Code, euler | Comments Off
Saturday, May 17th, 2008
So in progressing through Project Euler it is becoming more and more apparent that with slightly better math skills, I could be much more efficient at this. For example, my solution to Problem 9. While the code itself may not look all that messy, this is probably the WORST way to solve this one. My computer is not very happy with me at the moment, but I got the right answer damnit! But this just goes to show you, you can get the right answer the wrong way. In this case I was trying to find the ONE Pythagorean Triplet (a < b < c where a*a + b*b = c*c) that sums to 1000. With my solution I had it running through !3000 (3000 Factorial) iterations, or, more accurately, this lovely 9,131 digit number. I’ve gotta get better at this stuff.
Posted in Code, euler | Comments Off
Saturday, May 17th, 2008
Through overwhelming use of my brain powers, I have successfully (albeit, not particularly elegantly) solved three more Project Euler Problems. In Problem 5 I found the smallest integer divisible by all numbers 1 – 20. My solution to this one is TERRIBLE, but it works, so I haven’t fixed it yet. Problem 6 I found the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. I’m pretty happy with my solution to that one, but I’m no expert, and I’m sure all of these can be further simplified. Last on the updates is Problem 8 which came out nearly allright. I could pretty it up a bit, but it’s a decent way to muscle through this particular problem, which was to find the greatest product of five consecutive digits in the 1000-digit number given.
Keep in mind that there are much more intelligent humans solving these in much more intelligent ways than I am currently. I just happen to have gone slightly insane, and find it kind of fun to spend my Friday nights at home working on math problems and listening to Phil Ochs. If a version of myself were to time travel to now from the past, I’m sure he would be horrified to the point of self obliteration, and thusly eliminate all possibility of me ever falling into this lifestyle.
Posted in Code, euler | Comments Off
Friday, May 16th, 2008
Project Euler is a site that posits a number (196 to be exact) of mathematical and programming challenges, for anyone who feels up to it to take a crack. I do not feel, I am up to it, and yet I have solved three of the problems already. Just imagine what an even more intelligent human could do. The answer is solve more problems faster. The exciting thing with Project Euler, as with all programming problems is how many different ways there are to go about getting the same solution. Once you get the correct answer, you are let into a forum where many other solutions have been posted. It’s a nice insight into the infinite nature of these problems.
I’m no mathematician. In fact, up until very recently I have spent the greater part of my life avoiding math like an obscure dying relative, but recently, I’ve begun to understand it. Not in the sense that I can solve it, or that I am good at it, but the big picture, math in general, its elegance and in describing the patterns in the world and universe surrounding us. I never understood until now that math was REAL! Sure they tried to tell me all through school that it was very important because some day I’d have to use this stuff to do my taxes, but that is not the type of reality this math is expressing. Who gives a shit about taxes? (Sorry government). The real issue here is the nature of reality, the nature of existence. Math gives us (admittedly very obtuse and complicated for the uninitiated) ways of seeing this reality. Anyway, many people have expressed this much more elegantly than I have. I’m just for once having fun with math, and, being of an artistic mindset most of my life, I don’t know how to properly cope with my sudden plummet into hard numeric logic. Exuberance is working for now.
Posted in Code, euler | Comments Off
Thursday, May 15th, 2008
A New Version of the Cosmic Trip Java is up and running. This new implementation allows you to calculate Travel times for destinations close by as well as far out in the Cosmos. Just specify weather you want to travel Miles or Lightyears, tell it where you want to go, how far away it is, and how fast you’re going to be traveling, and it’ll take care of the rest.
Posted in Code | Comments Off
Tuesday, May 13th, 2008
After literally a week of trouble shooting, tinkering, and basically learning JavaScript, I’ve finally managed to convert my Cosmic Trip Program to a functioning JavaScript page. All the calculations work, it looks just fine, and it’s still as depressing as ever. The idea is neither complicated, nor novel. It is basically just a calculator that take a distance (entered in light years) converts it to miles, and tells you how long it would take to get there traveling at a speed given by the user. The result is incredibly depressing for people who dream of cosmic travel. For example: 1 lightyear is 5,878,499,810,000 miles. The closest anything to Earth outside our own solar system is a star called Proxima Centauri a mere 4.2 lightyears away. Even traveling at the high speed of 25,000 miles an hour, which is what is required to get outside of the Earth’s gravitational pull, it would take you, or your unmanned robotic craft 112,663 years and some change to get there. That’s considerably longer than the whole of human existence on this planet. It really puts things in perspective don’t it?
So anyway, see for yourself. Check out the Java Trip Program. Be sure to see how long it would take you to reach various celestial bodies in, say, your family Mini-Van.
P.S. The image is obviously not from my program, but from Galaga.
Posted in Code | Comments Off
Friday, May 9th, 2008

So it’s pretty un-pretty. And there isn’t much to do with it, but here it is, a dice game that pulls a random number between 2 and 36 and asks you to try and roll it (in a number of turns of course). If you win, it doles out the appropriate congratulations, if you lose, well, don’t lose. The code will go up soon. Until then, just roll real dice.
To figure out what the title of this post is in reference to look here. Escape from Atlantis. Yikes.
Posted in Code | Comments Off