U.S.A. R.I.P.

Regardless of the will of the people the House passed HR3590. Next step is to vote these arrogant, anti-liberty traitors out of office. Unfortunately, it will take years to undo this mess.
Posted in America by Mark (21Mar10 @ 1817)


Regardless of the will of the people the House passed HR3590. Next step is to vote these arrogant, anti-liberty traitors out of office. Unfortunately, it will take years to undo this mess.
Posted in America by Mark (21Mar10 @ 1817)
To get your article listed below please visit this link and link up your best work.
The following articles do not necessarily represent the views of imaginekittymagazine.
I’ve been considering the usefulness of adding a CSS management system to my CMS that I’ve been working on. Here are the steps I’ve taken to implement it.
I’m not sure that I’m convinced of the usefulness of this idea but it’s possible and easy to implement in your ASP.NET MVC project. The possibility of using variables in a CSS file is intriguing.
You may download a sample of the MVC2 project here. Let me know if this is a good idea, a horrible idea or just a bit interesting.
Edit – I’ve added a Response.Filter to this to remove extra spaces, tabs, carriage returns/new lines, final semicolons and comments. It brought the 4.96kb file down to 2.74kb.
Posted in ASP.NET, C#, MVC, Programming by Mark (26Feb10 @ 0946)
OK, I named this post that so that perhaps google will pick it up and those new to CSS will find this post.
There is a really good reason that there are no tutorials on the internet concerning how to add content (a site menu is the most common request) to all the pages on your web site using CSS. That’s because CSS doesn’t control content. It controls styling and nothing more. You don’t use styling to add content.
Why not look into some sort of server side includes. PHP includes will handle the situation. ASP.old can handle it but don’t use it unless you have no other choice (and you do). If you’re really fancy and modern and handsome and awesome you can just use ASP.NET MasterPages and/or User Controls.
To wrap it up, CSS doesn’t do that. Stop asking about it! Thank you.
Posted in Programming, Web design, Web standards by Mark (23Feb10 @ 2119)
Recently someone challenged me to write a server-side method for finding the current season and changing a style sheet accordingly.
The first step is deciding how to differentiate the seasons. I figured to use the day of the year so that astronomically Spring begins on March 21st, the 80th day of the year. Summer begins on the 172nd day, Autumn, the 266th and Winter the 355th. Of course, on a leap year add one day to each, 81, 173, 267 and 356.
Now to find the day of the year use the DayOfYear property. Also, use the IsLeapYear property to take a day away on leap year if the current day is after February 28th (the 59th day of the year). This is easily done by converting the bool IsLeapYear to an Int32 giving a 0 during non-leap years and 1 during leap year.
int doy = DateTime.Now.DayOfYear - Convert.ToInt32((DateTime.IsLeapYear(DateTime.Now.Year)) && DateTime.Now.DayOfYear > 59);
Then find the current season using a few nested ternary operators (I like ternary operators)
string currentSeason = String.Format("{0}.css",((doy < 80 || doy >= 355) ? "winter" : ((doy >= 80 && doy < 172) ? "spring" : ((doy >= 172 && doy < 266) ? "summer" : "fall"))));
I use this in the head of my MasterPage:
<link rel="Stylesheet" runat="server" id="seasonSheet" type="text/css" />
So all I have to do to add the correct style sheet for the current season is this:
seasonSheet.Attributes.Add("href",currentSeason);
Now a stylesheet named spring.css, summer.css, fall.css or winter.css will be added to your rendered MasterPage.
I hope you’ve found this helpful.
While reading about a recent question concerning @@Identity and the reasons to use SCOPE_IDENTITY() instead I experimented with LINQ to get the SCOPE_IDENTITY() results.
using (var dbc = new siteDataContext())
{
dbc.Log = Console.Out;
repertoire newSkill = new repertoire
{
skill = "a new item"
};
dbc.repertoires.InsertOnSubmit(newSkill);
dbc.SubmitChanges();
Console.Write(newSkill.id.ToString());
}
It seems that calling the id column of the inserted object gives you the SCOPE_IDENTITY(). Here is the SQL Log:
INSERT INTO [dbo].[repertoire]([skill]) VALUES (@p0) SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value] -- @p0: Input NVarChar (Size = 10; Prec = 0; Scale = 0) [a new item] -- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
Posted in ASP.NET, C#, LINQ, Programming by Mark (31Oct09 @ 1058)
http://www.youtube.com/watch?v=jbN-jO11vKg
Posted in Humor by Mark (29Jun09 @ 1818)
http://www.youtube.com/watch?v=Kr-e3qGQ884
Posted in Humor by Mark (15Apr09 @ 2105)
WebAIM‘s Screen Reader Survey, conducted December 2008 to January 2009, is a very interesting read. Yet another nail in the Flash coffin but surprisingly Frames are deemed easy to use by nearly 60% of screen-reader users.
Give it a quick look. Comments open.
Posted in Web design, Web standards by Mark (10Feb09 @ 2033)
Hello, friends! I've decided to put my Amazon wishlist online. If you feel nice today you can purchase one of the items listed and it will be shipped to my door. My birthday is May 13th and I will gladly accept gifts for any Christian or Jewish holiday. Thank you for your support.