Saturday, December 29, 2007
Tuesday, December 18, 2007
Lack of fonts for the lose
Blogspot! Give me monospace!
All I want is to have my blog (which I rarely write in) show up in monospace. Why? Cause my code editor is in monospace and it makes my eyes hurt less.
All I want is to have my blog (which I rarely write in) show up in monospace. Why? Cause my code editor is in monospace and it makes my eyes hurt less.
Friday, August 31, 2007
Tuesday, July 3, 2007
How cool was that!
On your O's update for July 3rd:
O's beat the White Sox in the top of the 9th inning! That was AWESOME. First time this year the heart break was on the other side (I don't like Mothers Day anymore). It was a complete team win. Patterson (who taught him to hit all-of-a-sudden?), Roberts, Gomez, Honeybear, Millar... they all had a game changing hit in the last 2 innings. I had given them up for dead and was on my way to the TV when Fields dropped the Millars soft grounder in the 8th. Then I thought, "What the hell, its 5 more outs." So glad I did.
O!, by the way, Erik Bedard - don't sweat it. Even god had to rest on the seventh day and you earned an off day, what with not giving up more than 4 runs a game since opening day (19 starts).
O's beat the White Sox in the top of the 9th inning! That was AWESOME. First time this year the heart break was on the other side (I don't like Mothers Day anymore). It was a complete team win. Patterson (who taught him to hit all-of-a-sudden?), Roberts, Gomez, Honeybear, Millar... they all had a game changing hit in the last 2 innings. I had given them up for dead and was on my way to the TV when Fields dropped the Millars soft grounder in the 8th. Then I thought, "What the hell, its 5 more outs." So glad I did.
O!, by the way, Erik Bedard - don't sweat it. Even god had to rest on the seventh day and you earned an off day, what with not giving up more than 4 runs a game since opening day (19 starts).
Monday, July 2, 2007
Developer Guide: ASP.NET Grid View Part 2
Common Properties
The GridView control offers a lot of your standard .NET properties, CssClass, Height, Width etc. But some of them are specific to the GridView. These include:
- RowStyle
- AlternatingRowStyle
- HeaderStyle
- PagerStyle
- EmptyDataTemplate
RowStyle and AlternatingRowStyle serve a similar function. RowStyle is the CssClass applied to ever ODD row in the GridView (1, 3, 5 etc.) while AlternatingRowStyle is for the EVEN rows. This lets you create a checkbook pattern to your grid views making it easier to read large amounts of data.
PageStyle and HeaderStyle are for the same thing as RowStyle but it styles the Header Row (duh) and the PagerRow. The PagerRow is the final row of the table following the FooterRow that is reserved for Paging Links. More these later.
The EmptyDataTemplate should also always be filled in. This is a set of HTML markup that is used in the case where the data set the GridView is bound to is empty. Under ordinary cirumstances this results in white space on the page. No header, no footer no nothin.
Always set these properties.
For the lazy among us (and yes I include myself) just cut and paste the following:
<AlternatingRowStyle CssClass="EvenRow" />
<RowStyle CssClass="OddRow" />
<HeaderStyle CssClass="HeaderRow" />
<PagerStyle CssClass="PageLinks" />
<EmptyDataTemplate>
<br /><b><span style="color: Red;">No Results</span></b><p />
</EmptyDataTemplate>
That closes the book on your style properties but there are a few more properties that you should set before close the tag:
- AllowPaging & PageSize
- AutoGenerateColumns
- DataKeyNames
- GridLines
AllowPaging turns the automatic paging of the grid on and off (true or false). If you turn this option on (true) you must also define a pair of functions to handle the OnPageIndexChanged and OnPageIndexChanging events. More on these later when I discuss paging. PageSize dictates the number of rows to be displayed before moving onto the next page of resutls.
AutoGenerateColumns turns on or off the automatic generation of column values and headers from your input data set. If this option is turned on (not reccomended) the GridView will examine your dataset and DataBind and generate one column per column in the dataset with a header named after the SQL column name. Why don't I reccomend this? First, its lazy. Second, you wont get to know your data. Third, SQL column names are rarely useful for your typical user. Fourth, trying to shoe-horn in better column names into your SQL select statement makes that statement a nightmare. And, ofcourse, .NET turns this on by default. Punks.
DataKeyNames is used to identify the primary key in the input data set. This only needs to be set if you're going to turn on sorting inside the GridView (another article). But it is good practice to always identify a PK column.
GridLines turns the automatic generation of table grid lines on or off. You can also specify Horizontal or Vertical lines only.
Too put it all together we get something like this:
<asp:GridView ID="JobSummaryGrid" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnDataBound="JobSummaryGrid_OnDataBound" OnRowCommand="JobSummary_ItemCommand" Width="884px" OnRowDataBound="JobSummary_RowDataBound" DataKeyNames="Id" GridLines="None" CssClass="ListView_Table" OnPageIndexChanged="JobSummary_OnPageIndexChanged" OnPageIndexChanging="JobSummary_OnPageIndexChanging" PageSize="20" CellPadding="0">
<AlternatingRowStyle CssClass="EvenRow" />
<RowStyle CssClass="OddRow" />
<HeaderStyle CssClass="HeaderRow" />
<PagerStyle CssClass="PageLinks" />
<EmptyDataTemplate>
<br /><b><span style="color: Red;">No Results</span></b><p />
</EmptyDataTemplate>
</asp:GridView>
Wednesday, June 20, 2007
Developer Guide: ASP.NET Grid View Part 1
I've decided to start collecting my accumulated knowledge regarding the ASP .NET GridView control. This is really for my own edification because I killed to many brain cells in college and now I can't keep everything in my head anymore. However, I do hop e that someone finds this useful so I'm going to try and write it at a fairly high level over a series of posts. I plan on covering the following topics:
The GridView control simplifies this way, way, down while still allowing you some very fine grain control. At its most basic a GridView control requires 1 markup line and 3 code behind lines.
Markup:
Code Behind:
string sql = "Query"
GridView.DataSource = Your.DataAccessLayer.QueryAsDataTable(sql);
GridView.DataBind();
Done. Yeah, yeah I took a shortcut and ignored things like in-page DataSources and I didn't actually tell you how to build your Data Access Layer, but these are things I wax poetic on later.
- What is the GridView control
- Common Properties
- The Columns collection
- GridView events - what you absolutely need to know
- Tricks of the Grid
The GridView Control
The GridView control is an ASP.NET control for formatting a set of data in a consistent manner. In web development the most common task asked for is the layout the results of a database query into a table on screen and allow the user to interact with that data. This used to involved tons of code, paging routines, and it caused a huge mess.The GridView control simplifies this way, way, down while still allowing you some very fine grain control. At its most basic a GridView control requires 1 markup line and 3 code behind lines.
Markup:
Code Behind:
string sql = "Query"
GridView.DataSource = Your.DataAccessLayer.QueryAsDataTable(sql);
GridView.DataBind();
Done. Yeah, yeah I took a shortcut and ignored things like in-page DataSources and I didn't actually tell you how to build your Data Access Layer, but these are things I wax poetic on later.
Monday, June 18, 2007
You should be daaaancing - yay!
Progress is a beautiful thing. Tim came over tonight and we busted our butts for 5 hours. See that pretty little box on the right? Thats what we got for our 5 hours. Yeah, you cant see it, but its our widget. And its wonderful.
This weeks developer tip: the K.I.S.S. development method. K.I.S.S. stands for Keep It Simple Stupid. My high school physics teacher taught us this when we were learning kinematic motion. It's the principle of keeping things as simple and straight forward as possible, but no simpler. It applies to development during refactoring of a functional unit. Factor the reusable components and leave the rest alone. Don't refactor a loops body if that loop body will not be used elsewhere. It might make for a function that is larger than one screen, but it makes it easier to maintain in the future.
Your Orioles update for June 18, 2007: Sam Perlozzo is out. 24 hours ago I would have cheered this move. But now I'm a little leary. I feel bad for Sammy on a personal level, but he wasn't getting the job done. He might have been a hometown guy and managing my beloved O's might have been his dream job, but he wasn't very good at it. The Warehouse is trying to get Joe Girardi to fill Sam's place and that would be a dream come true. But then again Girardi was a Yankee....MF Yankee's.
This weeks developer tip: the K.I.S.S. development method. K.I.S.S. stands for Keep It Simple Stupid. My high school physics teacher taught us this when we were learning kinematic motion. It's the principle of keeping things as simple and straight forward as possible, but no simpler. It applies to development during refactoring of a functional unit. Factor the reusable components and leave the rest alone. Don't refactor a loops body if that loop body will not be used elsewhere. It might make for a function that is larger than one screen, but it makes it easier to maintain in the future.
Your Orioles update for June 18, 2007: Sam Perlozzo is out. 24 hours ago I would have cheered this move. But now I'm a little leary. I feel bad for Sammy on a personal level, but he wasn't getting the job done. He might have been a hometown guy and managing my beloved O's might have been his dream job, but he wasn't very good at it. The Warehouse is trying to get Joe Girardi to fill Sam's place and that would be a dream come true. But then again Girardi was a Yankee....MF Yankee's.
Wednesday, June 13, 2007
Fancy Smancy
So my partner in crime figured out how to have a widget that is essentially an iframe into an ASP.NET page. Happy day! I was terrified that I'd have to turn my C# back in for VB Script again. Yick. Details later on when I get them from him.
At work today I got to:
- twiddle my thumbs
- write another boring report for accounting
- fix another apostraphe bug (apos. are reserved characters in SQL)
- and work on my big project
Why is it business development always changes the requirements on you after you've developed version 1? And not just changed the requirements, but screwed them all to hell! I hate management - and its not just my current crop of bosses, its every upper management (save Jeff, he was the shit) suit I've ever worked for.
Random SQL tip: Always replace an ' with '' before including it in any sort of insert, update or select statement. And remember, because you didn't think to try it your clients are certain to do so. Check every textbox field or foul characters. Oh and if you're like me, run your text thru a spell checker.
And on your Orioles watch: 7-4 loss to the Nationals. That game was so boring I feel asleep on my couch. Yes, the couch with a wooden board in the middle that makes my butt ache in 10 minutes. I digress. So here is your situation: bottom 9th, 1 out. Your "power" hitter has just launched a ball over the left field wall to bring you within 3 and the middle of the order has put a man on first and second. So the tying run is standing at the plate with a bat in hand. Who do you send up there? Queue Jeopardy music.
A) Paul Bako - your backup catcher who has been forced into starting w/ Ramon out
b) Jay Gibbons - your used-up left fielder with attitude problems who used to have power
c) Kevin Millar - the "heart" of the team who also happens to hit for power (sometimes)
d) Freddie "I-Only-Pinch-Run" Bynum - ok the nickname should give that one away
I eagerly await your answers. Is it football season yet?
At work today I got to:
- twiddle my thumbs
- write another boring report for accounting
- fix another apostraphe bug (apos. are reserved characters in SQL)
- and work on my big project
Why is it business development always changes the requirements on you after you've developed version 1? And not just changed the requirements, but screwed them all to hell! I hate management - and its not just my current crop of bosses, its every upper management (save Jeff, he was the shit) suit I've ever worked for.
Random SQL tip: Always replace an ' with '' before including it in any sort of insert, update or select statement. And remember, because you didn't think to try it your clients are certain to do so. Check every textbox field or foul characters. Oh and if you're like me, run your text thru a spell checker.
And on your Orioles watch: 7-4 loss to the Nationals. That game was so boring I feel asleep on my couch. Yes, the couch with a wooden board in the middle that makes my butt ache in 10 minutes. I digress. So here is your situation: bottom 9th, 1 out. Your "power" hitter has just launched a ball over the left field wall to bring you within 3 and the middle of the order has put a man on first and second. So the tying run is standing at the plate with a bat in hand. Who do you send up there? Queue Jeopardy music.
A) Paul Bako - your backup catcher who has been forced into starting w/ Ramon out
b) Jay Gibbons - your used-up left fielder with attitude problems who used to have power
c) Kevin Millar - the "heart" of the team who also happens to hit for power (sometimes)
d) Freddie "I-Only-Pinch-Run" Bynum - ok the nickname should give that one away
I eagerly await your answers. Is it football season yet?
Tuesday, June 12, 2007
My attention span kinda stin - oooooh a shiny
It's time. Time to break down and buy a laptop. I'm finally getting some income from the CENSORED website and while I was planning on using for Stephanie's ring I think its better spent on a new laptop. And probably one without wi-fi internet.
Why you ask? Because I cannot turn off World of Warcraft and get my work done (wassup Poets?). It's that simple. If I get a laptop with a crappy video card, go sit in an uncomfortable seat in Starbucks where there is no internet I might actually get some work done.
Then again, there is always solitaire.
And on your Orioles watch: The Birds had the night off last night, and Angelos (hereafter, PA) missed another opportunity to Fire Sam Perlozzo!
Why you ask? Because I cannot turn off World of Warcraft and get my work done (wassup Poets?). It's that simple. If I get a laptop with a crappy video card, go sit in an uncomfortable seat in Starbucks where there is no internet I might actually get some work done.
Then again, there is always solitaire.
And on your Orioles watch: The Birds had the night off last night, and Angelos (hereafter, PA) missed another opportunity to Fire Sam Perlozzo!
Testing 1, 2, 3
You know, I swore I'd never start a blog. I hate MySpace (I'm a Web Applications developer, it offends my delicate CSS sensibilities). Facebook, while cleaner, isn't much better in terms of content. Social Networking, to me, is just stupid. But, when you're given some cash to create widgets you need someplace to test them. So I started a blog.
Subscribe to:
Comments (Atom)



