Performance of Different Types of For Loops

In an old post I found online here the author asks how you would go about writing a simple for loop. I was bored tonight, so I wrote a simple program to time several different types of loops to confirm which is the fastest at iterating through a generic list, yes… that bored. My list contained 67,108,863 integers.

Here are the results:
Foreach loop: 1185.8ms

int tmp;
foreach (int i in array)
{
tmp = i;
}

Standard for loop: 932.1ms

int tmp;
for (int i = 0; i < array.Count; i++)
{
tmp = array[i];
}

Optimized for loop: 726.1ms

int tmp;
int cnt = array.Count;
for (int i = 0; i < cnt; ++i)
{
tmp = array[i];
}
Posted in C#, Programming | Tagged , , , , , | 4 Comments

Over 6 Months…

It’s been over six months and two quarters since I’ve posted anything. So at the beginning of last quarter, I began working on an ongoing project here at Neumont University known as NORMA (Neumont ORM Architect). This is the most complex project I’ve ever been apart of.

Last quarter I was working along with Josh, getting verbalizations working for the ORM subset constraints. After we worked on that for about eight weeks, we were assigned the task of creating the framework to make it possible for end users to generate a PHP back end once they get their information modeled. We were able to get this done successfully in 10 days.

This quarter I’ve been working on reverse engineering a database to ORM. This task has had its complications, but is coming along smoothly. When this is done I’ll be teaming up with Josh again to get the framework setup to generate a Java back end.

Also, since the release of Internet Explorer 7 (and its support for alpha transparent png’s), I’ve decided to go back to the old layout on the site. I’ve always thought it looked nicer, however it didn’t play nice with IE7.

I’ve also been on a team of a group of coders known as Revolutionary Networks. We’ve been working on a portfolio type project which will, in the end, display each of the members in Rev Net and display certain details such as which projects they’re working on, which technologies they know, where they’ve worked, their resume, etc. It’s a very in depth project that’s been going on for awhile.

Posted in General, Internet Explorer, NORMA, ORM, PHP, Programming, Rev-Net, Site | Tagged , , , | 7 Comments

Here it goes again

Quarter 5 here at Neumont University has started. Luckily I got into golf class so at least I get to have a little fun in between all of the work. This is what my schedule is looking like this quarter.

  • Golf
  • Game Programming
  • Calculus
  • Algorithms and Data Structures
  • Development in the J2EE Framework I
  • Projects IV

I’m pretty excited for the Projects class. This quarter I’m working on the PHPGedView project. Which is currently ranked #2 on the list of most active projects on sourceforge. My group is responsible for creating an Open “Source” Repository so that people can easily find more sources to look up information about their family tree. It’s a very interesting project and I can’t wait until we get past the database design and start the coding.

I also landed a grading position this quarter, so I have some source of income. I’m grading the Topics in Software Development, which is a class that all of the new students have to take. It’s pretty interesting to see the different things that get turned in and the different ways people decide to do things.

I’ve started playing World of Warcraft again after giving it up for about a month. I’ve decided that I’m going to finish leveling my Rogue and transfer it to Kalecgos since they’ve opened realm transfers. Most of the people that I used to play with decided to give the game up, and I have some friends on Kalecgos, so.. goodbye Tichondrius.

That’s really all that’s going on right now. Since it’s 1AM and I have Golf bright and early in the morning, I’m going to bed.

Posted in Games, General, Neumont, PHP, Programming, Software, WoW | 2 Comments

Pandora

The other day Trip told me about something called Pandora. It’s a cool little program that lets you listen to music and build your own station. You add an artist you like, and then it’ll start playing. You then say if you like the song or not, and it goes from there.

It uses information found from the Music Genome Project to hone in and figure out exactly what you want to hear. Very cool.

Trip also showed me something called Digg. This is a cool news site that shows you popular stories from across the internet. It’s pretty cool, too.

Posted in General, Software, Technology | 1 Comment

Love is…

A man and a woman, who have never met before, but are both married to other people, found themselves assigned to the same sleeping room on a
transcontinental train.

though initially embarrassed and uneasy over sharing a room, they were both very tired and fell asleep quickly… he in the upper bunk and she in the lower.

at 1:00 am, the man leaned over and gently woke the woman saying, “Ma’am, I’m sorry to bother you, but would you be willing to reach into the closet to get me a second blanket? I’m awfully cold.”

“I have a better idea,” she replied. “Just for tonight, let’s pretend that we’re married.”

“Wow! That’s a great idea!” he exclaimed.

“Good,” she replied. “Get your own fucking blanket!”

after a moment of silence, he farted.

Posted in Jokes | Leave a comment

Marsupials and their multiple sex organs… damn those Marsupials

We’re walking around Wal-Mart today, and my roommate Josh tells me that koala bears have *two* vaginas. I didn’t believe him at first, but I looked up it, and it checks out. Male koala bears have a *two* pronged penis. This gives me a whole new look on life.

Source: Here

Posted in General, Science | Leave a comment

It's the 4th Quarter now

Well, yesterday started the fourth quarter here at Neumont. Here’s my class lineup

  • Algorithms and Data Structures
  • Astronomy
  • Development in the .NET Environment III
  • Projects III
  • Role-Based Software Development
  • Trigonometry

It ought to be a fairly good quarter. I’ve got a pretty good team for projects and none of the classes seem too overwhelming.

I’ve decided to give wow a break for awhile. I’m going to try and find something interesting to code in my spare time instead. Either that or try and find something fun to do here in Salt Lake City, which probably won’t happen anytime soon. It seems all of the clubs are only 21+ which really sucks. My roommate found a promising hookah bar to go to, but after we made the plans to go, we found out you had to be 21 to get into it. So those plans were shot down pretty quickly.

Posted in Games, General, Neumont, WoW | Leave a comment

Ragnaros Downed

We took rag on our 4th attempt.

See Screenshot (i’m the Gnome in the Dreadmist Mask, to the left of the bear, in front of the dwarf ;] )

If you want a place to upload pictures and have them hosted, I’ve created a simple image uploading script which can be found here.

Posted in Games, WoW | Leave a comment

Project 2 — Complete

Finally, we’ve finished our second, and final, project for Projects 1.  Code freeze was tonight and we got it in.  I must say it’s probably the biggest piece of shit I’ve ever had the pleasure of working on, but it’s over.  Seriously, why not use objects in an object oriented programming language?  Classes, who needs those… I don’t really get it, but whatever.  We turned in our Form1.cs that contained over 2500 lines of code and called it good.  I’m hoping that next quarter I can get in a team with someone that has more knowledge of program design so that I can really learn how programs such as these are supposed to be coded.

Posted in C#, General, Neumont, Things that piss me off | Leave a comment

Flock

I downloaded Flock today and it seems pretty cool.  It has a built in blogging untility, which I’m testing out right now. Just a wild guess, but I’m going to say it’s based off the Firefox source, since it looks surprisingly similar.

The quarter is almost over, thank god. I’ll be happy to get back home for Christmas and hang out with all my old friends that’ll be there, unlike last time I came home when they were all gone at school, lol.

Posted in Browsers, Flock, General, Technology | Leave a comment