Tuesday, October 14, 2008

http://projecteuler.net Problem 2

This problem asked to sum up all even Fibanacci number up to 4,000,000. This code executed in .02 seconds


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProjectEularProb2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
DateTime dtstart = DateTime.Now;
List numb = new List();
List lastNumb = new List();
int x = 1;
int y=0;
//numb.Add(x);
listBox1.Items.Add(x);
lastNumb.Add(1);

do
{
y = lastNumb.Last();
x = x + y;
listBox1.Items.Add(x);
if (IsEven(x).Equals(true))
{
numb.Add(x);
listBox2.Items.Add(x);
}

lastNumb.Add(x - y);
}
while (x <= 4000000);
textBox1.Text = numb.Sum().ToString();
DateTime dtend = DateTime.Now;
label3.Text = "Program took " + dtend.Subtract(dtstart) + " to complete";
}
private bool IsEven(int x)
{
int y = x % 2;
if (y==0)
{
return true;
}
else
{
return false;
}
}
}
}

Monday, October 13, 2008

http://projecteuler.net Problem 1

So I found this cool website that I think will keep me entertained for a while called http://projecteuler.net

I was able to solve Problem 1 pretty quickly. I am going to use C# to solve these problems. It is probably not the most elegant code, but if you know me that probably does not surprise... Here is the source to problem 1

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProjectEularProb1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

List numlist = new List();
bool alreadyThere = false;

private void button1_Click(object sender, EventArgs e)
{

List numbs = new List();

numbs.Add(3);
numbs.Add(5);

foreach (int x in numbs)
{
FindMultiplesUnderAG(x);
}

textBox1.Text = numlist.Sum().ToString();
}
private void FindMultiplesUnderAG(int x)
{
int y = 0;

for (int i = 0; i <= 1000; i++)
{
y = i * x;
if (y < 1000)
{
foreach (int z in numlist)
{
if (y == z)
{
alreadyThere = true;
}
}
if(alreadyThere.Equals(false))
{
numlist.Add(y);
listBox1.Items.Add(y);
}
alreadyThere = false;
}
}
}

private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
listBox1.Items.Clear();
numlist.Clear();
}
}
}

How to rename every file in a directory from a command prompt

Found this on another site (forgot where) Just in case I need this in the future

Create a .bat file and paste in

for %%f in (_*.*) do call :renamer %%f
goto :eof

:renamer
set old=%1
echo %1
ren %1 %old:~1,9%
:: end

in line 1 the _ is the character pattern to match
on line 6 change ~1 to the number of characters from line 1

So its been a while...

Thought I would re-purpose this blog to be more of a personal notes site. We'll see how this goes

Monday, April 23, 2007

SLU Trivia Nights

Two nights of trivia at SLU, we did not fair well at either one. We didn't even want to know we finished...


Best Question: What Major League pitcher retired with 363 wins and 363 hits?





Answer: Warren Spahn

Tuesday, February 13, 2007

St. Simon Trivia Night

We went to a trivia night at our old Parrish of St. Simon on Saturday 2/3. It was one of the largest, if not the largest trivia nights we have ever been too. With 55 tables and 8 persons a table, there was a lot of people... We started off strong and were in 1st place after 5 rounds, but we could not finish strong and ended in a tie for 6th place with 69 points.

The best question of this night was actually the 1st question of the round.

Q. In the movie Christmas vacation, what were the names of the Grizwold's neighbors?

A. Todd & Margo

Saturday, January 27, 2007

2007 Trivia Night Kick Off

Today was the 1st Trivia night of the 2007 season. It was held by the SLU Business school Alumni. We placed 4th out of 19 with 81 points, only 1 point behind 2nd & 3rd (who had to go to a tie breaker to determine their place). The most interesting question of the night...


Q. Dave Winfield was drafted by 4 different leagues in 3 different sports. Name the 4 leagues. (We got this one right)



A. MLB, NFL, NBA, ABA

Monday, August 28, 2006

Finally Won

We have this bi-annual golf tourniment with all of the guys (16 of them) on my Mom's side of the family named the MRZ (named for family last names). I have been paricipating in it for about 7 years now, and I won for the 1st time. I am not a great golfer, but certianly not the worst in the field, I was just in a lot of bad situations. There was a joke going around about the Curse of Tim, and I am happy to report that the Curse of Tim is over. I would like to thank my teammates my uncle Sean and my brother Steven for helping me break the curse.

Sunday, August 20, 2006

Rasure Commandments

I have been meaning to put these back on the website for quite some time. I am just to lazy to create a page on my real website and one click publishing is so much easier.

Raising 3 boys was probably not the easiest thing to do (especially if you knew me and my brothers). In the course of raising us, our parents would yell/slash sternly advise us to do. Sometimes those phrases were so ridiculous, that they had to be written down some where. Here is that place. I give you the Rasure Commandments (King James edition).

1. Thou shall not be mad dogs when the bread comes*
2. Thou shall wipe thy greasy hands before throwing thine ski ball
3. Thou shall not thown thy new glow in the dark football at thine fireflies.
4. Thou shall move thine carrots so thine father can get up from his chair.

Since a parents work is never done, so new commandments will be added. I know that I have forgotten some so I will try and keep this updated the best that I can.

* The parents cannot totally take credit for this one as it was later learned it was a line from the Cosby Show (but it was still said to us in full earnest)

Long List of Fried Foods

A while back I thought to myself "I should really try to sample fried foods in this world that are not traditionally fried." I think now I am calling off that dream. I went with the inlaws to the Festival of the Little Hills today in St. Charles, where they were serving fried pop tarts. Being a fan of pop tarts I thought that this would be a home run, however like the twinkies and oreos this also was a miss (threw about half of it away). It got me thinking that fried does not necessarily equal good....

Sunday, May 28, 2006

Ultimate Ski-Ball Champion

Karen and I went to Dave & Busters tonight because we felt like doing something different. We played an assortment of games and had a good time. Karen said that before we left she wanted to play some ski-ball. We both played 15 - 20 games. On my last game I won the Dave and Busters ski ball grand bonus prize for scoring over 450 (how's that for delivering in a crunch). I scored 490 and won over 1000 tickets. It took 5 mins before the machine could dispense all of the tickets. I was ecstatic raising my arms in victory, I still have a big smile on my face :) Luckily I was not paying too close attention to my score or how many throws I had left until I sank my 3rd 100 point ball which brought me to 440. That is when I turned to Karen and in a cool calm and collected manner said "You want to see something cool"? I threw my last ball, it is pretty tough not to get 10 points on throws, but I dropped it in the 50. It really was my night, and I did it !!!

Sunday, February 19, 2006

Hey Big Spender

This week capped the biggest spending week that Karen and I have ever had comdined in our lives. Last weekend we purchased a 2005 Ford Escape Hybrid (seen below) and a 50'' Sony LCD HDTV. Needless to day we will not be going out to eat or spending money needlessly for a while.

Wednesday, February 08, 2006

Assult on 100

As part of my set of New Year's resolutions I joined Webster's gym, specifically to swim in the morning before work. They have a white board chart for distance of swimming for members that goes all the way up to 100 miles. Yesterday I got my first mark swimming 1 mile. It took me about 6 days of swimming over 2 weeks. Now that the laps are coming a little easier, I expect the marks to come a little quicker (mile 2 is coming along a lot smoother). 1 mile = 70 laps

Monday, November 14, 2005

AndyPoluzza

The first annual AndyPoluzza happened on Sat Nov. 12. There was drinking, music, drinking, Bar-B-Q, drinking, washers, drinking, physical destruction to cars, and drinking. It was over all a fun time, although I realize now that I am a lightweight compared to Andy and some of his friends. I would post pictures, but I forgot my camera, not that any needed to be taken that night anyway. ;) We would like to thanks Tony for hosting and hope he does not hate us all too much...

Wednesday, July 20, 2005

Fried Twinkies Downtown Las Vegas


Me eating a Fried Twinkie & Oreo. Interesting taste, even for $.99 not sure I would do again.

Sunday, July 03, 2005

New Busch Stadium





Went to the Cardinal game today, they lost :( But inside the old Busch Stadium you had a great look at the new Busch Stadium. Here are a couple of the shots.

Wednesday, June 29, 2005

Our New House


Here is a picture of the new house that we just moved into. (My phone is a pretty good camera)

Sunday, June 12, 2005

Hercules


Lifting the Jeep with poor technique. Notice, lifting with my back and not enough with my legs. :) Thanks to Louis for the picture.

Sunday, April 03, 2005

Banana Pictures Finally Found

We have been doing a lot of cleaning this weekend. One good result of this was that I was finally able to find the giant banana pictures that we had taken several years ago. So before I forgot, I scanned them in, now we finally have them digitally. Go to Rasure.net > Pictures > Infamous Banana Pictures and check it out.