Kicked the Internet addiction

I realized the other day that I am no longer addicted to the internet. It was fun while it lasted, but then you get bored. You see the same stuff everywhere (excluding the personal sites).

It wasn't a very long lasted addiction. During my senior year of high school (1996-1997) was when it started. I would go on our dial-up to Prodigy and go into chat rooms, because that's really all that Prodigy had, as far as I was concerned. I'd chat with people, meet "girls", talk up my mad guitar skillzzz, exchange emails, etc. Then came college.

I wasn't a very education oriented person. I found nothing in high school that interested me (except physics and math of course), so I had average grades (except in physics and math of course). By the end of high school, I was getting good grades because I basically beat the system. I knew how to do the minimal amount of work and still pass with Bs. This didn't necessarily involve studying, neither did it involve cheating... basically, I just paid attention in class and did the homework. Most of the time. See, Bs didn't require full attention and one hundred percent complete assignments. It was fun. So, when I got into college, I had to go to a "summer school" of sorts. You go there for the summer, take 3-4 classes a day, and if you pull a 2.5 average, you're in for the fall. Well, this summer, as you can imagine, was a blast. 2.5 is lower than a B! I was and probably always will be shy. However, I saw a kid there that I knew I could be friends with. One day I saw him on the computer in the computer lab, so I went in and joined him. I noticed he was in a chat room, so I asked him what chat room he was in, and he told me. We hit it off after that, being roomates for two semesters, one of which being "THE semester". Tom and I got our best grades ever during college our first semester together (Spring '98). We had Computer Science I (one) together. I whooped in that class. Put it this way, when the final came around, I was the first to hand it in, 15 minutes after I started, and Tom said it was 20 minutes before anyone else left. I aced it. I ended the semester with a 3.5 average or something. I was taking other courses, like writing and Calculus II. While Calc was extremely interesting, it was a B@#%@!! So, I got out of that year, and into the next semester, "THE semester".

The Fall 1998 semester started off really bad. During the summer I was working for my Dad as the assistant to the computer guy, saving up money to buy a computer. I got it later that summer, and that's when my life ended. Basically. The Fall '98 semester was not my best one. In fact, it was by far the worst. We're not talking "missed a few classes" here. We're talking, from around late September til the end of the semester, I went to a handful of classes. I was nocturnal. During one stretch, I slept 12 hours a day. I was the bomb that semester though, both socially and electronically. Socially, I was friends with everyone on the floor. Our room was the hangout. We'd have people in there at all hours. Our most was 14 people at one time. Electronically, I was the bomb too, as I had downloaded software (I forget what it's called) that allowed you to run a P2P server. I had so many people on that server, downloading files, uploading files, chatting with each other, leaving me messages, etc. All told I left that semester with about $12000 worth of software that was not paid for, and about 1500 mp3s. (I should mention that I no longer found any of that software useful and deleted it all).

This server ended my chance to graduate college ever. Or so I thought.

After that semester, I convinced my parents to let me go back to school. Luckily, they bought it. I went back and graduated with a B+ in my field of study, so it worked out. That semester was also my enlightenment period. I had Computer Science II, and was completely lost. However, towards the end of the semester, just playing around (because I didn't go to classes, but still loved writing programs), I became enlightened to Object Oriented Programming with C++. The s@#%@ just made sense after that.

That was pretty much the strongest point of my internet addiction. After that, it dwindled down to what it is today, where I can't f@#%$#$!$12 stand the internet. I can read the news though, or a handful of personal sites that I visit, or slashdot, but if I find myself just clicking s#@%$ mindlessly, I'll just walk away most of the time. The other times, I'll close my browser and do something else, like program. Or play a game. Or go outside and play with the dog.

That's one addiction that I'm happy to get rid of -- the internet in general. I have to kick this email addiction next. I check 34,859 times a day. Although, I will easily go a few days without it, so it might be a matter of just throwing out my cable modem. Share or link your stories below!

Poker Night, I WON!!!

Well, to me I won, as in I put in $10 for the buy-in, and left with $20! I came in second place. We were playing Texas Hold 'em. At the start, the cards were falling for me. I won the first hand, which was a nice boost in confidence (and chips). Then I sat back for a few hands, then won a hand with 4 (FOUR) KINGS!!! That was a huge hand, and I basically had enough chips to last me a while. Two others were in the hand, and they were betting because they had full houses with 3 Kings on the board. I had a king in my pocket and just kept betting. The last King fell on the river, which made everyone bet huge. I knew I couldn't be beat, so those guys were the ones gambling, not me. I'll tell you though, my heart was pounding for a good five minutes after that hand. The adrenaline rush is nothing that can be beaten.

Those two were pretty much the only good hands I had. I did eliminate two people, my brother Pat and Jeff's coworker, and coincidentally a guy who I went to high school with, Joe. For Pat, I caught a 10 on the river or something. For Joe, I had A, J suited spades, and he went in with nothing, and got nothing. I think I won with the high card. When it came down to just three of us, I was the definite underdog. Two of Pat's friends, Mitch and Tim, were the other two left. They had mountains of chips like I had towards the beginning of the game, only multiplied by 6 other people's chips. I had basically the same amount I had since I won the Kings pot. You win some and you lose some... I tripled up a hand with those two, going all in and both of them calling. I forget what I had because after poker, we all went to Casey's and got ripped. Then the one hand. 8, J, J on the flop. Tim goes all in like he has 8,J in the pocket. Mitch has an 8, and after several minutes of deliberation, he calls. I was long gone on this hand since I was dealer. Tim has neither, and no cards fall to help him. He's gone. I almost conceded victory since I had around 800 chips, and Mitch had like a bazillion. Three hands later I go all in on a suited combo, like K, 10 or something. I lost. But I won $10! Mitch won $60.

That's always a blast. It's a great way to spend $10, if you last a while. Then you go to the bar and talk about the great hands that everyone played.

Online Crack

Money is incendiary. That s@$%@# burns right through anything I put it in. Has my whole life. Not like I spend it all, but when I get money, I have to buy SOMETHING. Well, not all the time. Like, now I'm trying to save. Thanks a lot Amazon.com...

I head there today, and there's a "4 for 3" deal, buy 3 books, get one free. Well, if that's just about as ignorable as a punch in the face. I have to buy books now. I need KNOWLEDGE!!! Bad timing on their part. I just placed an order yesterday, but not for books! Sweet! I've always been great at justifying purchases.

But, yesterday I ordered 2 movies and the 2nd season of the X-Files. The first one was outstanding, I recommend it to anyone. Oh, and I ordered a video game (Lumines for PSP). There's nothing like feeding your addictions with a few clicks. Ask the mice who repeatedly press a button that injects them with cocaine. I saw it once on Discovery.

So, today I'll place another order. Good thing I signed up for Amazon Prime all those weeks ago. Now I can get free 2nd day delivery, so it doesn't matter. I can place order after order after order... after order. And they have to ship them for free, since I paid that $79 for the year. They lose out on that one.

I'm getting to a point where I don't have to have a video game within 4 nanoseconds of the exact nanosecond that it is released. So I'll probably order more games online that will be coming out soon. Of course, those game makers should just be selling their games online so I can download them... but, that might take just as long as ordering online and getting free second day shipping.

[Update] Bleh, just found out that no books that I want for knowledge can be classified under any of the following (the only books under their 4 for 3 deal):
* General Fiction
* Mystery
* Romance
* Science Fiction & Fantasy
* Baby Books
* Kids: Ages 4-8
* Kids: Ages 9-12
* Teens

What a bummer. What, "Game Programming" isn't generally accepted as a "Kids: Ages 4-8" book? I guess I should stop trying to teach it to my 6 year old niece :) Although, they should really fall under "mystery", since I'm buying them because I don't have a f#@#@$ing clue about the subject matter... because if I already knew, then I wouldn't be buying it!

stringed.org launches!

It's very, very young. Basically, last night, I went from being able to only add a new "Author" to being able to edit and delete them, as well as detect that a book has an "Author", and when editing a book, to show a list of authors to choose who wrote that book. Feel free to try it out. There will be bugs for a long, long time, and I've noticed quite a few on those two simple objects, so just bare with me.

There are quite a few object types that I need to support in order to be able to convert this website over to the new system. First thing's first, though. Naming the software! Considering the fact that it's using the same exact version of "dumb" as this website, and the whole front end is built using information collected from "dumb", it's only right that it be called "dumb web" (read about it here).

So far, the development is progressing nicely. I hit a few speed bumps last night, but just glided over them and now it's just a matter of supporting more object types. Right now, you can see that "Foreign Keys" are supported (if you know your database talk), as well as strings (like Author name and Book title), and another type of string that I'll just call a "long string" (or "text" to the db folk), which is tested with a biography on the Author object. Other object types to support would be dates, files, many to many lists (like news can be in many categories), one to many lists (a poll's answers are entered in a list), and a potentially long list of others. It should be fun, and will probably never be done.

Check out the site here. I prefer that everyone access it without the "www." in front, because it just looks cooler, but the non-cool way is still supported... for now :-P

I did nothing this weekend

It was awesome! Here's a report.

Friday, went home, ordered pizza, played an NHL 2k6 tournament with my brother and his friends, and WHOOPED ASS. During my off time (96.4 percent of this weekend) I was writing software for stringed.org, and got somewhere with it. I got my hair cut. I watched football. I drank coffee. Flyers played on Saturday (won 2-1 vs. the Penguins). Some guy (a coworker) beeped at me today because my headlights were on as I was walking away from my car into work.

I'm so awesome at NHL 2k6. At least vs. my brother and his friends. I lost one game to Bean's friend Drew, and I apparently don't take losing too well, because the next game I was ahead 8-0 at the end of the 2nd period! I won 9-3 as Drew took out his goalie looking to score 5 goals in the last minute and a half. Then me and Bean played an extended tournament final on Saturday, best of 7, and I won 4-3. OK, it was only best of 7 because I hate losing, and kept saying "Best of X" where X is the next odd number after Bean jumped up to win the previous one. I am a sore loser, but it's only because I'm awesome and I will win most of the time. :)

The Flyers' game on Saturday was on NBC instead of its usual spot on Comcast Sportsnet or Channel 57 (UPN). I hate NBC games. It's only the announcers. On the other two channels, we have great announcers. Jim Jackson, Gary Dornhoeirififfer (no idea), and Coatesy (like, coat-sey). They know about the Flyers, who's great, certain players' tendencies, what they do well, etc. Watching that game on NBC was the worst experience watching a Flyers game EVER. Those guys are complete idiots. They probably have never played hockey in their lives, for one thing. Also, everyone in the NHL world who is not a fan of the Flyers gets word of this player on the Penguins named "Sidney Crosby", and they just want to make out with him. You could tell that they were expecting the Penguins to win, just because they had Sidney Crosby. After they said his name everytime, I swore I could hear them kneel down in honor of him. All they kept saying was "Crosby's out there now" or "Crosby is excellent" or "Man, I love Crosby" or "Can I have Crosby's children?". At one point, Jeff had switched channels, and it had been a few minutes, so I asked "Yo, is the Sidney Crosby show back on yet?" Also, showing the complete lack of Flyers knowledge of the announcers, they say towards the end of the game "Michal Hanzus has had an excellent defensive game." If they had seen one game, they would know that he plays an excellent defensive game EVERY game. He's a forward, but he's still incredible. Another thing about these f#@%$!#! as#!$@oles is that they don't pronounce anyone's name right. Jim Jackson is great at this. He seems to have studied different languages so he knows how to pronounce "Radivojevic" and "Desjardins", and other tough names.

Getting told that my headlights are on is nothing new to me. My car seems to be the only one that keeps its headlights on for a few seconds after I lock it up as I'm walking away from it. I've owned it for over 3 years now (-3 months while it was being repaired after the accident), and I always get told that if people are there to see it. I do tell them that they'll go off, and I thank them for letting me know, but have they never seen a car that keeps its headlights on for a few seconds? They're daytime lamps so they're always on when the car's on.

[Update] Here's an idea of how big Crosby is in the NHL... the Pittsburgh newspaper (Post-Gazette) has a section on their website called Crosby Watch

Haha!! I read an article, the "At 14, Scout sold on Crosby" one, just for material to post on here. I found this:

"Two, three guys in the corner, and he always pops out with the puck. From the waist down, his legs must be unbelievable."

He hopes that it's not all that's unbelievable below his waste.

Friday Afternoon Paper Reading

Reading the paper today, I learned that the Flyers acquired Petr Nedved from the Coyotes! They traded Dennis Seidenberg (who needs Germans on the team, anyway?). They should have traded Chris Turnover... er... Therien. He's made one good play all year. Before any Germans go all anti-German on me, I'm 50% German, it was a joke :) It's my better half.

Then I came across this mountain of useless information. "Pa. milk production climbed 4.5 percent in 2005". Obviously someone thinks it's important. It's like, 4.5 percent. If that's important, then it would be just as important to note that my facial hair has grown 4.5 percent in the last 4 hours. Or that I've put a steady 4.5 percent of full, actual work in the time I've been here today. Plus it's MILK. I could see Oil production raising 4.5 percent being news. If that's news then so is "Hair gel production rose 4.5 percent in 2005."

It may show my complete lack of business knowledge, but that's not anything I'm trying to hide! I know how to buy stuff and pay bills, that's all I really need to know :)

In other news, nothing interesting happened today. It's Friday. If "slacking off at work on Friday" made news, then everyone would be in the paper, and we wouldn't have to deal with reading about the output ability of Pennsylvania's cows over the last year.

I thought I'd throw this in here... a few weeks ago I watched the news on local TV for the first time in literally 3 years. It went like this: "Death, Robbery, Death, Accident, Traffic, Death, Murder, WAY TOO HAPPY WEATHERMAN". I'm like "HOLY S@#$%#@ That guy is WAY too happy following all that bad news." The mood swing, if I had let it happen, would have been big enough to cause a heart attack.

More Math

This is basically a personal post to Todd, but anyone is allowed to join in. Feel privileged. Or you can use this time to listen to my latest song, "Should Be Sleeping", at the bottom of this page.

I did some research on amicable numbers, and tried and succeeded to write a program that calculates an amicable number given a number. Then I tried to write it so it loops for a while, listing any amicables it finds. The problem is it's slower than death. The key, obviously, is finding the right function to calculate a sum of divisors of a number. It's brutal. This is what I have so far.

    private int sumOfDivisors(int n){
        int sum = 1;
        int max = (n/2)-1;
        for (int i = 2; i < max; i++){
                int x = (n/i);
            if (n % i == 0 && i < x){
                sum += i + x;
                max = x-1;
            }
        }
        return sum;
    }


I adjust "max" based on the last divisor, so, knowing that (for instance) 3 divides into the number 81 times, it should now only loop up to 80. Then, later on if it finds that 9 divides into it 27 times, then it will only loop up to 26. This is just knowing that basically, since we're counting up, there will be no number above 27 that divides into the number that hasn't already been accounted for. Try it out. Then, to take care of that number, I add it to the sum and just adjust the max loop amount, significantly dropping the iterations needed to get the sum of the divisors, improving overall performance by a factor of around .00000001 :) Here are some results.

(NOTE: It takes 50 seconds because I'm looping from 10,000 to 11,000, checking each number for an amicable twin. To find out if a single number has an amicable twin isn't *that* bad :p )

10744 has an amicable number of 10856
from 10000 to 11000 took 50178 milliseconds.


Then from running it without adjusting the max loop

10744 has an amicable number of 10856
from 10000 to 11000 took 50228 milliseconds.


So, that's the key. If there's a formula out there for getting the sum of the divisors, it would greatly help, but I searched for a while and couldn't find it.

The general function body looks like this

        int amicable = 0;
        int sum = sumOfDivisors(n);
        amicable = sumOfDivisors(sum);
        if (n == amicable) {
            // We have an amicable number stored in "sum" (not "amicable", since it will be the same as "n" if they are amicable)
       }


50 seconds sucks. There should be something better out there. I even tried to save the trouble of searching numbers later on in the sequence that have already been determined to have or not have an "amicable twin". Anywho. It was fun.

[Update] I just remembered that division on a computer is like painting. It doesn't like to do it at all, but is asked to do it because the person who usually has to do it doesn't feel like it either, but the person asked is pretty good at it. Anyway, I changed the function so that it's faster. It doesn't divide as much. I just ran it on my laptop (1.5 GHz, 1GB ram, Linux), and it did the loop (10,000 - 11,000) in 125 milliseconds. I'd say that's a bit improved... unless it's just Linux :)

Found amicable (28,28)
28 is also a perfect number
Found amicable (220,284)
Found amicable (284,220)
Found amicable (496,496)
496 is also a perfect number
Found amicable (1184,1210)
Found amicable (1210,1184)
Found amicable (2620,2924)
Found amicable (2924,2620)
Found amicable (5020,5564)
Found amicable (5564,5020)
Found amicable (6232,6368)
Found amicable (6368,6232)
Found amicable (8128,8128)
8128 is also a perfect number
Found amicable (10744,10856)
Found amicable (10856,10744)
Found amicable (12285,14595)
Found amicable (14595,12285)
Found amicable (17296,18416)
Found amicable (18416,17296)
time took was 3266 milliseconds


(NOTE again... Description of Perfect Numbers)

That can't be Linux. 3.2 seconds?!? That's a loop from 2 to 25,000!! The other function took 50+ seconds to go from 10,000 - 11,000. The machine at work is a 1.7 GHz (faster than this laptop) with a GB RAM running Windows XP SP2 and the same version of Java. 4 divisions cut to 2 doesn't normally shave off 50 seconds... now I'm curious.

[Update] Forget it. I forgot I was throwing in a sleep everytime it looped... idiot. Anyway, Windows is still slower on a faster machine. 171 ms for 10k - 11k, vs 125 on Linux.

I wish my SSN was 123-45-6789

Because I'd be famous to programmers everywhere! SSN of course is Social Security Number. Whenever we programmers write a program that takes an SSN for input, the most highly used test data for the field would have to be "123-45-6789". Just because the counting style of the number lets you know when to stop. "Stop at 9", I always say to myself. Whereas if you were to put in "111-11-11111", you might enter too many numbers (as I just did, which, of course, is a good test of your software).

Similarly if you live at "123 Main Street, Anytown USA". Your address, probably only second to Santa Clause's, is one of the most written in the world :) Of course, this is all speculation.

But out of those two examples, there has to be someone with the SSN of "123-45-6789". There'd have to be! Well, no there wouldn't. That sequence of numbers allows for 1 Billion permutations (10^9), and there's *only* ~280 Million in the SSN using world. I hope in my next life I get that SSN.

Words are fun

sesquipedalian: (of words) long; having many syllables. (adjective)
noun:
A long word.

Used in a sentence : The word "sesquipedalian" is a sesquipedalian.

Man, I'm awesome. But, I don't know many sesquipedalians.

Fun with Math

Yesterday, I wrote a function for Todd to show him some Java since he's learning it. It was a Fibonacci sequence calculator. Basically, you pass in the index of the sequence that you want, and it'll calculate it for you. So, today, I'm killing some time, and I wanted to figure out how much time it took to figure out some high up numbers of the sequence. Well, the function that I wrote originally pretty much sucks, but it works and it conveys some pretty fun stuff in computer science. First, an explanation.

The Nth number in the Fibonacci sequence is defined as the (N-1)th number plus the (N-2)th number. Or, the Sum of the previous two fibonacci numbers in the sequence. The sequence starts as 1,1,2,3,5,8,13,21,34, ... ending with F(N-1)+F(N-2), or F(Infinity-1)+F(Infinity-2). So it doesn't end. Anyway, there's some good documentation on it out there. Here's the first function I wrote:

public long fibo(int n){
    if (n <= 0) return 0;
    if (n <= 2) return 1;
    long ret = fibo(n-1) + fibo(n-2);
    return ret;
}


Here's the new, much faster function :

public BigInteger fibo2(int n){
    if (n < 3) return BigInteger.ONE;
    BigInteger fn = BigInteger.ONE;
    BigInteger last = BigInteger.ONE;
    BigInteger last2 = BigInteger.ONE;
    for (int i = 0; i < n-2; i++){ // n-2 because first 2 are 1
        last = fn.add(BigInteger.ZERO);
        fn = fn.add(last2);
        last2 = last.add(BigInteger.ZERO);
    }
    return fn;
}


I had to use BigInteger (in the java.math package) because after about 100, "long" couldn't fit the result anymore! That's a big F@#%$!$#!ing number that a long could hold!! But not big enough.

For mathematical clarity, there is a formula out there, called Binet's formula, that calculates the Nth fibonacci number.

F(n) = (a^n - b^n)/(a - b)

I'm having problems with types, I can't get it working.

But for the fun of it, here's some output:

For #40:
102334155
Fibo2 for fibonacci #40 took 0 milliseconds.
102334155
Fibo for fibonacci #40 took 4811 milliseconds.


For #42:
267914296
Fibo2 for fibonacci #42 took 10 milliseconds.
267914296
Fibo for fibonacci #42 took 12955 milliseconds.


As you can imagine, the second one in the results (the function simply named "fibo") will be an unbearable burden to the rest of my experiment. So, I'm getting rid of it and will show you some major f@#%R@#ing numbers produced by "Fibo2". Check it out.

176023680645013966468226945392411250770384383304492191886725992896575345044216019675
Fibo2 for fibonacci #400 took 10 milliseconds.


WHAT IN THE WORLD IS THAT NUMBER?!?!?!?!!! Holy crap!! And 10 milliseconds. Let's see 500!! I wonder when BigInteger overflows... maybe never.

13942322456169788013972438287040728395007025658769 7307264108962948325571622863290691557658876222521294125
Fibo2 for fibonacci #500 took 10 milliseconds.


(I had to put a space in or else my website would be all f'ed up... but that's one number continuous)

That's incredible. "For my next job, I'll take a salary of $Fibo(150)." That's huge :) Anyway, I had fun. I want to see how far it will go before blowing the hell out of my computer, but that will be an experiment reserved for tomorrow at work :) It's not my computer then.