Sunday, May 01, 2011

Greenest House In the STL

I thought that I would like to start recording everything that we have been doing to go more green/sustainable for our house. From here on out I am going to start writing down my thoughts (mostly for my own benefit/memory). So stay tuned, if you are interested.

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.