Open Excel files in a new window

I am used to viewing files in different windows and when I found Excel forcing me to view two spreadsheets inside the same MDI form I looked for an alternative.

Realistically I thought that an option would be available allowing me to choose how Excel opened multiple documents but I was wrong.

If you want to open two Excel files in different windows for whatever reason, you need to modify the File Association actions.

Since I use dual monitors on a daily basis, this "fix" is a must in order to take advantage of having a dual display.

The answer can be found in the following article: Open Excel in Different Window

AR

Full code for PageRank tool in C#

I’ve uploaded a copy of the code in a demo website for the pagerank tool in C#.

You can download it from: Full PageRank code with demo site

I’ve tried out a few websites and URLs that people have posted to me and got mixed results. I will be updating it if I can find fixes. In particular the hash seems to fail on some sub-directories.

Download it and try it out for yourself. Feedback is always welcome and drop a comment while you’re here.


UPDATE

The previous code was being blocked by Google for some requests due to a mis-calculated hash. This has been fixed now and the download updated.

You can also checkout my online demo at (not currently live)


UPDATE

I’ve been asked by Aaron Brown to provide a VB.net version of this code or at least of the StrToNum part. I’ll take a look at this shortly. Or if you have partly-working code, send it over and I’ll see if I can help out.

Website thumbnailer in C#

After some searching around for ways to implement thumbnails simply for a directory site I am working on I decided to adapt some of the available options into a thumbnailer that I could use.

This is currently in development but when complete will be made available as a downloadable Windows forms app for those who are interested.

Details to follow shortly

Thanks,

AR

C# Google PR Checker

I’ve had some feedback about the google PR checker I have written in C#.

Basically I will be adding a property that allows you to select the datacentre to query and I will be randomising the PR requests where this property is not set.

Additionally I will be adding an automatic double-check facility so if a site ending in a slash doesn’t return a PR it will check again without the slash and vice-versa.

I will post again once the updates are made and post a link to the download.

For those of you wanting to download the current version, you can find it here:PageRank tool in C#

Thanks,

AR

Not to use XYZ for .NET Hosting

A few months ago I started having trouble with my hosting provider. This started off with short bits of downtime which you attribute to updates and essential maintenance – no problem.

Then things got more serious and I noticed that the hosts had been having hardware and software issues and not correctly restoring my sites, access passwords and databases.

At this point I started to look elsewhere.

I decided that after using lesser-known companies for the last few years I would use xyz – a big name who offered exactly what I thought I wanted. They offered .NET2 hosting with MS-SQL.

Initially I kept my old hosting account live (and I’m glad I did).

Things didn’t get off to a good start with the new hosting company.

Firstly I couldn’t use SQL Management Studio to access my database but was instead forced to use some pathetic web-based system which made creating databases a complete pain.

Importing data was even worse as in order to import data on their system you had to either import a CSV file from your PC (which means it must be small or the script times out and import fails). Or you could upload a backup or Access database for import.

If you upload a file, sometimes it doesn’t show for hours and other times it shows straight away (I put this down to vetting or some such human interaction on xyz ’s part).

In order to import a backup it must use the same or earlier file reference (or version). Using SQL 2005 myself I found this a struggle. The alternative is importing a MS-Access file which means a load of conversion problems from the off – no thanks!!

So I am not currently using the MS-SQL service from xyz in any meaningful way (which was my main reason for choosing them as a host).

Then I come to using .NET and hosting multiple domains.

Let me just say having spent ages faffing about with ways to do this: it’s not worth it.

The icing on the cake is if you take a look at xyz.com (I am forced into using xyz.co.uk) you can see that US developers are getting a much better deal for their money: vastly bigger storage and huge bandwidth allocations in comparison to the UK version (hosted in Germany by the way).

Just found out something else today. As a windows hoster, I cannot set (in the control panel) my default page!

So what have I learnt from this experience?

1. Not to use xyz for Windows hosting of multiple sites using .NET and MS-SQL.
2. Their control panel is great for day to day stuff.
3. Their email service is great and I haven’t got a problem with it.
4. Not to try and get any useful response from their support department.

Please note this is a rant on my behalf and not a generalised slating of xyz. If you want a generalised slating of xyz then just have a look in Google. xyz are not popular with windows hosters.

If you want to know who xyz are then get in touch. Since this is a personal blog site I’m not gonna name them on here.

Silverlight and where it is now

I’m always looking for ways to improve the websites I develop for people and my new interest is Silverlight.

Microsoft table this as:
“Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web.”

It’s only in it’s early stages yet but it has the workings of being a very useful and powerful tool. There are many things I have noticed that it cannot currently do simply but it should be noted that companies like Adobe/Macromedia have been working of presentation technologies for the web for a good few years now.

Once of the main limitations in the current versions of Silverlight are the lack of input controls such as simple textbox entry and webcam support. It seems that initially the technology has it’s focus on presentation of pre-made content and will couple quite nicely with Windows Media Server.

So if you are looking for a method to deliver content such as videos with a delicious and simple to create interface then look no further than using Silverlight. Adobe currently has a massive lead in this field but if Microsoft can eat into it like they have eaten into Search Engines and search features then there’s a good chance that in 1-2 years even the most die-hard Flash developers will be considering Silverlight.

I think the current strength of the Silverlight offering is it’s integration with Visual Studio that will allow C# developers and the like to vastly improve their content presentation. Lord knows that techies do not make the best-looking things.

I’ll be initially looking at using Silverlight to stream videos from a Windows Media Server but I hope that when the newer versions of the Framework become available they will integrate webcams and use input to a useful and intuitive level.

You can’t really say something is platform and browser-independent if you can’t give the user the same experience across the board. My reason for saying this is that some techies are getting excited about Media encoding with Silverlight when it’s not natively a part of the package. For me the two need to go hand in hand before I will recommend using Silverlight over Java or Flash media gathering when I know that my users may not be on Microsoft platforms.

It looks good Microsoft so please don’t wimp out on us. This could be the start of something great

C# PageRank Tool

After much trawling of the Internet all I could find for automated PageRank gathering was a PHP script or two.

Now since I don’t like to write in PHP, I wrote a version in C#. I haven’t included the source code but I have created a downloadable ZIP containing the C# dll and a test project.

In order to use the dll, simply reference it in your project as follows:


using PageRank;
...
private void btnPR_Click(object sender, EventArgs e)
{
try
{
TGooglePR _pageRank = new TGooglePR();
string _PR =
_pageRank.ReturnPageRank(txtSiteURL.Text);

lblPageRank.Text = “PageRank: ” + _PR;
}
catch (Exception ex)
{
lblPageRank.Text = “Fault Occurred!”;
}
}

Have fun with it!

Go to downloads page

Citing a useful source

The code for calculating the distance between points that I have posted in C# was based upon the work published at: http://www.movable-type.co.uk/scripts/latlong.html

Anyone interested in this should also look for a downloadable list of UK postal OUT codes which is freely available (If I find the link then I will include it here).

All these things can be put together with something like Google Maps API to display routes, POIs and locations.

SQL Injection attacks

Although I have researched SQL-Injection attacks before, as with any securty issue its important to see if new attacks have emerged.

Since I mainly develop in .NET and T-SQL a lot of the recommended input-checking etc is the same story as usual: parse input and where possible limit the characters allowed.

For many developers these kind of things are ignored initially because of the trial and error approach that they use in developing. I develop class-based and tier-based solutions and therefore any cleansing necessary can be easily implemented without duplication of code.

As a recommendation to all working on new projects, I would recommend creating separate classes or layers for data-pulling and pushing (to and from the DB). In this way, most cleansing can be done in one place and the format of the destination fields can be used to determine the limit of characters for submission to the database.

Where possible use Stored Procedures and very importantly, handle errors so no clues are returned to those attempting unauthorised access. Secondly, log failed attempts, the contents of those attempts and their originating IPs so you can adapt any methods you have in place for dealing with them.

Remembering the Basics of SEO

All too often in the search for better ways to improve ranking those of us in the business of doing many different tasks are guilty of forgetting the basics.

My girlfriend remarked something to me yesterday about needing to decide on keywords before using them in descriptions – which is of course correct. But there are many times when I haven’t stopped to concentrate on the placement of keywords in the description that match keywords exactly as used elsewhere.

The truth is that I don’t spend enough time concentrating on the simpler aspects of SEO before running off into the off-page paradigm.

Return top