
My New Year resolution is to make more sense in my code and my blog posts.

My New Year resolution is to make more sense in my code and my blog posts.
If your ASP.NET application worked fine in your Development environment, but after deploying it to staging or production crashes with error:
Could not load type System.Web.UI.ScriptReferenceBase from System.Web.Extensions
most likely it was compiled against .NET 3.5 SP1 but the target machine has original .NET 3.5 framework without SP1. The solution is download Service Pack 1 and install it on target server. Another possibility – compile the project against original .NET 3.5 framework.
If you’d like to generate a steadily increasing stream of income online in addition to your day time job, you can do it in 6 easy steps and once initial setup is done, everything is completely automatic, you won’t have to do a thing. (If you already have a blog and don’t need content posted to it automatically – jump directly to step 6).
4dfbc478
4dfbc47d
4dfbc47f
4dfbc481
After signing up you will get a small block of PHP code which you can add either to your blog’s theme templates (for example header or footer) OR install a PHP widget plugin, paste the code there and drag the widget into a sidebar.
TNX displays unobtrusive text links on your pages, for the links you are credited TNX points, which you can cash via PayPal. Links are sold on every page, so the more pages the blog has – the bigger income. And having Unique Article Wizard will add unique pages to your blog every day. I already implemented this approach on 7 of my autoblogs you can see here:
Automotive News
Real Estate News
Building and Construction News
Ecommerce News
Business News
Travel News
Web Developement
You can repeat steps 3 thru 6 to add new blogs adding even more to your income.
If you have any question about any particular step or if you need a new invite code to TNX, please leave a a comment here.
If you’re using Microsoft Chart control for .NET 3.5 you can specify where and how chart images are stored. And if for this purpose you’re trying to use Chart HTTP Handler setting in web config similar to this:
<add key="ChartImageHandler" value="storage=file;url=./Temp"/>
and it is failing (for example chart images are alway created in the root folder of your Web application) – there is an alternative. You can specify location of the images in properties of the chart control itself:

Just add relative path to your storage folder in front of the chart sequence string in “ImageLocation” property. and specify “UseImageLocation” for “ImageStorageMode” property
LINQ is truly integrated into VB.NET. This allows not only to use LINQ-specific query language in a standard VB.NET code, but use VB.NET code in a LINQ query. Consider function from the previous post. To make it universal we can pass one more parameter
“Aggregate Type” and based on that parameter return Min, Max, Avg, Sum or Count
Function GroupBy(ByVal i_sGroupByColumn As String, ByVal i_sAggregateColumn As String, ByVal i_dSourceTable As DataTable, i_iAggregateType as Integer) As DataTable
dim aQuery = From row In i_dSourceTable Group By Group1 = row(i_sGroupByColumn) Into Group Select Group1, Aggr = Choose(i_iAggregateType, Group.Min(Function(row) row(i_sAggregateColumn)), Group.Max(Function(row) row(i_sAggregateColumn)), Group.Sum(Function(row) row(i_sAggregateColumn)), Group.Avg(Function(row) row(i_sAggregateColumn)), Group.Count(Function(row) row(i_sAggregateColumn)))
return aQuery.toDataTable
End Function
In this example VB.NET function Choose is used inside of a LINQ query’s Select Statement. If i_iAggregateType parameter is equal 1 – Minimum value, will be calculated, 2 – Maximum etc.
I’ve described before how to group and aggregate data in ADO.NET data table using standard .NET 2.0 features. But if you happen to use .NET 3.5 or above and Visual Studio 2008 or above – that entire block of code can be replaced with a single LINQ query:
Function GroupBy(ByVal i_sGroupByColumn As String, ByVal i_sAggregateColumn As String, ByVal i_dSourceTable As DataTable) As DataTable
dim aQuery = From row In i_dSourceTable Group By Group1 = row(i_sGroupByColumn) Into Group Select Group1, Aggr = Group.Count(Function(row) row(i_sAggregateColumn))
return aQuery.toDataTable
End Function
The query at line 3 is a LINQ to DataSet query, so reference to System.Data.Linq has to be added to your project. The Group.Count aggregate can be replaced with Group.Max, Group.Min, Group.Sum or Group.Avg to perform respectful function.
There is one caveat though. Continue reading →
Sometimes I bring information to a couple of my other WordPress blogs via RSS feed. It’s a nice feature, allowing you to create several posts at once without manual entry. Unfortunately if RSS feed is broken or improperly formatted it can result in blank posts imported into the blog.
I was looking for a WordPress plugin that would allow me to mass-delete empty posts, but apparently none exist. You can delete posts based on date, tags, category, but not the content. Fortunately if you have access to phpMyAdmin of your MySQL installation – there is a solution. Continue reading →
This is December of 2009 and Google has an interesting Easter Egg in its Search page. If you leave the search field blank and click “I am feeling lucky” button Google displays countdown in large numbers:

From the looks of it it’s a countdown to New 2010 Year. It’s coming 🙂
There is a new masterpiece for sale at Amazon

Using this amazing device you can place your laptop right on the steering wheel of your car. Just imagine playing “Grand Theft Auto” while driving a real car – what can compare to that? Also this not being a cell phone will never get you in trouble with the police.
As one of the avid fans put it: “What makes this product so wonderful is that now I can write letters while I drive! No more texting, no more tickets! I have been keeping up with all my friends and they appreciate how much more “personalized” my letters are than my texts. If there is any drawback, it’s on windy roads, because sometimes I make stray marks on the tighter curves, but it’s a small price to pay for staying within the law!”
If you open an IE Modal Dialog window and later on need to resize it using JavaScript code, standard “window.resizeTo” method doesn’t work. Use dialogWidth and dialogHeight instead. For example:
window.dialogWidth='640px'; window.dialogHeight='480px';