I recently gave a presentation on LINQ at the Utah DNUG. I will be be posting parts of the presentation of the next little while as well as some stuff that i was unable to cover due to the time limitations. So keep a look out for it.
For those of you who know me i don't really play very many video games. I do however get addicted to little flash games. One of these games is called onslaught, its simply another tower defense game. The word on the street is that to get very high in the game you have to use a lazer chain. Well today i got to level 381 with out one.
I have been playing with the new .NET 3.5 framework. Several people asked to see that samples that I was writing just to try stuff out so I decided to make a little post. This is just some simple code I wrote to teach myself the basics so its nothing special. I should have some LINQ samples up later. If you have any questions feel free to ask.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace Sample
{
class Program
{
static void Main(string[] args)
{
//create some sample objects
var p1 = new Person { firstName = "Matthew", lastName = "Osborn" };
var p2 = new Person { firstName = "Mark", lastName = "Osborn" };
var p3 = new Person { firstName = "Karen", lastName = "Osborn" };
var d1 = new Dog { Breed = "Shetland Sheep Dog", Name = "Baxtor", Owner="Matthew" };
var d2 = new Dog { Breed = "Shetland Sheep Dog", Name = "Rip", Owner = "Matthew" };
//add these objects to two different collections
var people = new List<Person>();
people.Add(p1);
people.Add(p2);
people.Add(p3);
var dogs = new List<Dog>();
dogs.Add(d1);
dogs.Add(d2);
//join people and dogs on owner first name
var test =
people.Join(dogs, p => p.firstName, d => d.Owner, (p,d) => new { p, d });
//print out results
foreach (object o in test)
o.print();
}
}public class Person
{
public string firstName { get; set; }
public string lastName { get; set; }public override string ToString()
{
return firstName + " " + lastName;
}
}public class Dog
{
public string Name { get; set; }
public string Breed { get; set; }
//referances a persons first name
public string Owner { get; set; }public override string ToString()
{
return Name + " is a " + Breed;
}
}/// <summary>
/// Static class to hold all my extension methods
/// </summary>
public static class Extensions
{
//generic extension method to print items to the console
//This can easily be used for debuging
public static void print<T>(this T obj)
{
Console.WriteLine(obj.ToString());
}
}
}
Are my two Bosses moonlighting as UDOT workers in there spare time. They come to work with bright orange shirts on just like UDOT works... My guess is that they are moonlighting as UDOT workers, what other explanations could there be? Why else would anyone wear a bright orange shirt? Lets take a vote.
Introduction
Having been following the iPhone for some time now I had considered more than once the thought of buying one. I currently have AT&T and have the HTC 8525 (not a bad phone) so I was in no real hurry to get one. After getting off work I decided drive down to The Gateway (where the apple store is) and see just how bad the line was. I got the right after 6:00pm, some where around 6:05pm.
iDisappointment
- The Keyboard Sucks!!! there is no way to type using your thumbs, the keys are too small. No way to be able to use the keyboard without looking at it. Keyboard takes up half the screen and does not work in landscape mode.
- No file explorer. All file organization has to be done inside of other applications
- Internet access was extremely slow!
- You can't take videos. (I knew this before)
- No speed or voice dial.
- When switching to landscape mode it took several seconds for it to recognize the changes.
- Overall the iPhone seemed very laggy and unresponsive.
- No expandable storage
- Most 3rd party headphones will NOT work because of the sunk in jack.
- Can't highlight, cut, copy, or paste text from a website.
- Can not sync with Exchange Server for email
In the end I think the iPhone is nothing more than a novelty for people that like to look cool or apple FanBoys. There is no way the iPhone will become the phone that apple wanted it to. It lacks to many simple features that a cell phone/PDA/mp3 player should have. This is simple not a phone for anyone who wants to do more than make calls and listen to music. In short if you want to be productive on the go DO NOT buy an iPhone.
PROBLEM:
The new CSS 2.0 standard contains a new interesting feature
called viewports. I am not sure yet why they have introduced them but I do understand
some problems with them. Recently I was
working on a website that had a three column layout with a dynamically sized
centered column. Basically the right and
left column are only borders nothing special.
I’m a fan of all DIV layouts and that’s how I laid out the website, I’m
not going to go into why I use DIV as apposed to TABLE that’s a whole other
blog. The problem I was running into was
that my right border would not continue down the page when a scrollbar was
present in firefox but worked fine in IE. In fact the border was only the
height of the current window.
Ok so after a little bit of research ok well a lot of research I found that the height of 100% was being pulled from the viewport rather than the page. The viewport is basically an object that is the size of the current viewable area on the browser. I haven’t had time to play with it and figure out what they are good for or not so good for. The reason as to why it worked fine in IE is that IE does not fully support the CSS 2.0 standard and viewports apparently aren’t something they viewed as important.
CODE:
HTML:
<body>
CSS:<div id="divRightBorder">
<div id="divContent">
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="Content" runat="server">
</asp:ContentPlaceHolder>
</form>
</div>
</div>
</body>
body
PICTURE:{
min-width: 725px;
background-color: #FFF;
background-image: url(images/background-left.gif);
background-repeat: repeat-y;
background-position: left;
}#divRightBorder
{
background-image: url(images/background-right.gif);
background-repeat: repeat-y;
background-position: right;
height:100%;
}
#divContent
{
margin: 0px 50px 0px 50px;
background: #fff;
clear: both;
}
SOLUTION:
So heres the solution to get this layout to work in weather or not the browser fully supports the CSS 2.0 standard. If you put the DIVs inside a set of containing DIVs it will work perfectly. Basically I believe that the reason for this is that the height is pulled from the viewport only for the first set of DIVs this allows the inner DIVs to overflow and function as normal. I know this isn’t a very good explanation but to be honest I haven’t had a whole lot of time to research it. Here is a copy of the working code and a picture of it working in firefox.
CODE:
HTML:
<body>
<div id="rightborder">
<div id="innercontainer">
<div id="rightborder2">
<div id="innercontainer2">
<div id="text">
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="Content" runat="server">
</asp:ContentPlaceHolder>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
CSS:
body
PICTURE:{
min-width: 725px;
background-color: #373737;
}#rightborder
{
background-color: #FFF;
background-image: url(images/Background-Right.gif);
background-position: right;
background-repeat: repeat-y;
height: 100%;
}#innercontainer
{
background-image: url(images/Background-Left.gif);
background-position: left;
background-repeat: repeat-y;
height: 100%;
}#container2
{
background-color: #b82f2f;
}#rightborder2
{
background-color: #FFF;
background-image: url(images/Background-Right.gif);
background-position: right;
background-repeat: repeat-y;
}#innercontainer2
{
background-image: url(images/Background-Left.gif);
background-position: left;
background-repeat: repeat-y;
}
If you could write a book about anything, what would it be about?
In the highly unlikely event that I was to write a book it would probably be about something computer related. At this moment since I am learning Atlas AJAX i would probably write a book about it because Atlas is pretty difficult to get working correctly in a production environment.
Well after awhile of searching I have found a coffee shop that is open late in Salt Lake City. John, Katie, Dustin, and myself all decided to go down to hang out and do some work there last night. It is a nice place has a great atmosphere and decent coffee. The problem was about an hour into the ordeal some douche bag decided he was going to make an ad-hoc computer-to-computer network with the same ssid. My guess is that he was trying to steal some people’s passwords. So, john decided to play along he added a share to his computer that asked who the guy was and connected to his network. Long story short the person is a douche bag and did not stop and or play along so we left. Tonight it is back to the coffee shop with some tools and this person is going to get pwned if he is there.
apparntly i hve ben told tht i cant spel at all.
What song or lyrics are stuck in your head at the moment? What album is it from?
Submitted by Lox Ly.
I really can't get my muppits song outa my head its kinda amazing