AKA Marketing.com Logo            VISIT THE BLOG            

Blogged thoughts, is our web blog. Expect views, opinion, rants and tirades about everything and anything 

« Home / Forums »        

 


Subscribe to our SEO / IT related blog by entering your email address below

Blogged thoughts

| by the www.akamarketing.com team

Archive for August, 2008


Reeling in the years… Irish soccer legends special

Wednesday, August 20th, 2008

While clearing out the fire damaged wreck that is my house I came across a couple of old photographs of me and my brother with Irish soccer legends Paul Mcgrath, Jack Charlton and Ray Houghton. I think the photographs were taken in the Forte Crest Hotel (not sure if this hotel is still in existence) in Dublin Airport just before the Irish team were about to set of to Italy for the 1990 World Cup.

I’m in the green looking a bit scared. Apologies to big Jack for him missing half a head in his photograph.

As usual the Irish soccer lads were very accomodating towards the fans in terms of photos and signatures. Check the photos out below, click on them to open up bigger versions :


Is 02 mobile broadband worth it for a fiver a week?

Thursday, August 14th, 2008

I’m a laptop user these days, so to keep with the whole ‘work anywhere’ gig I’m trying to perfect I decided to invest in one of the mobile broadband offerings from 3G, O2 or Vodafone. Truth be told 3G were out before they were even in… I’ve heard a lot of negative things about their overall (speed, reliability & customer care) service, in both the online and offline worlds so I wasn’t going there. As for Vodafone well reliability is meant to be top notch, however it’s €30 a month and has a data cap is 5GB which 02 beats on both counts, so I said I’d look into 02 more…

While I was researching the mobile broadband offering from 02, one of the most important things for me was speed, reliability too of course… but that’s a given. I needed decent download speed but perhaps as important (well not quite) for me was upload speed as being a developer I’m uploading this, that and everything via FTP on a daily basis. 

Speed for the 02 mobile broadband service is currently listed as 7.2Mbps for download and 2.0Mbps for upload although they must have upgraded upload capabilities within the last few days because when I ordered last week upload speed was listed as 1.4Mbps, which is good in itself. Those speeds where more than adequate for my needs. I was aware however that these listed speeds are the theoretical max speeds one can achieve given absolutely perfect network conditions, so I wasn’t expecting to get anywhere near them in reality. The truth however is that higher theorectical speeds generally mean higher ‘in the wild’ speeds too so considering it has a 10GB data cap and after a little checking on it’s reliablity I said I’d give 02 mobile broadband a go.

I bought it online (by the way - no sim pin number is included when the modem is bought online for security reasons - you need to call, email or post in their support forum to get it) and it cost €49 for the E270 (the E220 is less powerful upload speed wise) modem and then €20 a month as part of a 12 month contract. I got it the other day and am very happy with it so far, below is some snapshots I got from Speedtest.net. The 1st one is the max I’ve achieved so far while the 2nd one is what I got earlier today.  

Both are decent results in terms of download and upload speed. I found 2.5-3.0MB is usually average territory for download speed, while upload average is about 800-900kbs mostly. Quality of service is good too - I’ve made about five long Skype calls since getting this lad in and no problems at all, call quality was as good as DSL based calls. By the way Blacknight have a nice VOIP simulation test at http://www.irishisptest.com/runmyspeed.php which you can use to check how your Internet connection will perform (roughly) using VOIP. As far as I’m aware VOIP call quality has a lot to do with Ping speed (as well as upload/download speed obviously), which above is 159ms and 162ms respectively from left & top which is good for mobile broadband. Call quality on Skype etc. may be a bit hairy on Ping speed of I’d say 270+.

Although I haven’t had it long I’m very happy with it to date, I’ve heard it can be very location dependant (I’m based in Santry, North Dublin) though so depending on where abouts in Ireland you are it might not work as well for you as it is doing for me. On that note check out the Speed Test Thread on the 02 support forum for a load of Speedtest.net result snapshots from various parts of the country. You’ll notice that some of them are not that flattering, but most are decent and considering that mobile broadband is still really new in this country ‘decent’ for five euro a week should be good enough for most people. Word on the wires is that they have plans to upgrade to 14.4Mbps sometime in the next year or so which when it happens should really stir things up.

I wonder though will us Irish ever have it as good as our UK counterparts, the variety of packages and special offers for home, mobile and other broadband services is massive, for instance (and since we’re talking about 02) check out this deal from 02 in the UK which offers free home broadband when you buy mobile broadband.

Resources:
Apparently the software that comes with the 02 modem does not accurately track data usage, I’ve yet to notice but Shane O’ Sullivan has written a tool which logs in to the 02 website and gets your 100% accurate figures.

Another recent review which includes figures from a couple of different locations around Ireland by Conor O’Neill.

Keith Bohanna’s review of 02 mobile broadband from September 07 includes more sample speeds from various different locations, notice the sometimes huge differences between location A and location B so do your research before investing.


Filtering & sorting DataTables with DataTable.Select() in C#

Tuesday, August 12th, 2008

We all know that connections to databases from within our applications cost us processor cycles and thus time so it’s a good idea to only ‘talk’ to your database when you really need too. In the .NET framework items like DataSets and DataTables etc. facilitate this to a large degree and allow you to update date with ‘too’ much pain. In this post let’s take the .Select() method of the DataTable class as evidence of this.

.NET framework 2.0 DataTable.Select() method
The DataTable.Select() method has four overloads and allows you to filter and display your rows in a number of ways in a manner similar to the way SQL does. The method can accept an expression string which although not nearly as powerful as full blown SQL does provide the advantage of not having to go back to the database to do simple things like showing records relevant to only a certain date range or a certain customer, product etc.

Below is some of the valid expressions and filters you can pop into the Select() method to narrow your record set.

Standard Operator based expressions
Things like >, <, >=, <=, =, <> are all supported of course. If your DataTable was called salesStaff and you only wanted to return staff with sales of greater than 100, you could do this with salesStaff.Select(”sales > 100″). An array of DataRows will be returned, so depending on what you want to do with the results of the Select() method you may have to copy them back into another DataTable… more on that below.

More SQL query like expressions
Filtering by Like is also supported by the Select() method which I think is quite sweet. Wildcards as in SQL are * and %. Just like most variations of SQL support aggregate types so too does the Select() expression ‘language’. Items like AVG, MIN, MAX, SUM and COUNT are all supported, so too are functions like LEN and SUBSTRING. If you need to test multple columns/conditions you can join them with the AND or OR operators but be careful if your using .Net 1.1 SP 1 as there was a documented bug in .Select() when it was used with AND.

Sorting with DataTable.Select()
This is probabely the main way I use the Select() method. Its supported not via the expression parameter but via the sort parameter which is available in two overloaded .Select() methods. Its format is columnName asc/desc.

Importing DataTable.Select() method results into another DataTable
Putting the results from a Select() query into another DataTable is often a requirement say for instance if you wanted to bind your results to a control. As mentioned above the Select() method returns an array of DataRows and since DataRows are the main building blocks of DataTables the process is very easy. Steps outlined are:

Issue .Clone() your source DataTable to create a new DataTable with the same schema
Issue .Select() on your source DataTable() to get an array of rows with the data you want
Loop through the DataRows array and issue .ImportRow() on your destination table each interation

and a code snippet to do the above might look something like the following:

//copy the schema of source table
DataTable above24 = dt.Clone();

//get only the rows you want
DataRow[] results = dt.Select(”age > 24″);

//populate new destination table
foreach (DataRow dr in results)
above24.ImportRow(dr);

DataTable.Select() shortcomings
The main things I don’t like about the .Select() method is how you have to go through intermediary steps to get your results into another DataTable, why can’t it just return another DataTable (which is directly bindable to a load of .NET data controls) and its lack of support for selecting distinct/unique rows which is often needed. As as note on that last one, it is possible to return distinct rows in a DataTable using LINQ which is a .NET 3.5 component, however that topic might best be served with another post at a later date.

Can’t I just use a DataView instead of calling DataTable.Select()?
You can and DataViews are directly bindable to many controls too, however it is not always the best solution due to the generally accepted believe among many developers that .Select() is much faster than using the DataView equivalent of RowFilter (property). I regularly interchange between the two for a lot of small database projects, however for the projects where I need to be processing a mega amount of data I pretty much stick with .Select() 100% of the time as I reckon it provides real speed (as in seconds, not PC invisible micro time) advantages compared to DataViews.


Importing XML data into a SQL Server table with C# asp.net

Sunday, August 3rd, 2008

I’d rather not store the XML files Im using in my current project onto the server as they are very verbose so I decided to use the SQLBulkCopy class in .net to allow me to write the data (and only the data - no schema related stuff) within the XML files to a SQL Server database table which gives me the power of SQL (for data filtering) which I’m more familiar with than XPath. The process for doing this is extremely easy, check out the code snippet below:

DataSet reportData = new DataSet();
reportData.ReadXml(Server.MapPath(”report.xml”));

SqlConnection connection = new SqlConnection(”CONNECTION STRING”);
SqlBulkCopy sbc = new SqlBulkCopy(connection);
sbc.DestinationTableName = “report_table”;
      
//if your DB col names don’t match your XML element names 100%
//then relate the source XML elements (1st param) with the destination DB cols
sbc.ColumnMappings.Add(”campaign”, “campaign_id”);
sbc.ColumnMappings.Add(”cost”, “cost_USD”);

connection.Open();

//table 4 is the main table in this dataset
sbc.WriteToServer(reportData.Tables[4]);

connection.Close();

//remove the xml file

Basically your creating a DataSet, populating it with XML data from a *.xml file somewhere on your system and passing the DataTable of interest from your DataSet into the WriteToServer method of the SQLBulkCopy class. The table specified in DestinationTableName must exist, additionally if your DB column names do not match your XML element names 100% you will need to use the ColumnMappings property to let SQLBulkCopy know which XML elements match to which DB cols. In the code above I’m telling SQLBulkCopy to pair the ‘campaign_id’ and ‘cost_USD’ columns in the DB with the ‘campaign’ and ‘cost’ elements from the XML file. XML elements which are not explicitly specified will not be written to the DB table.

The SQLBulkCopy class is available in the System.Data.SqlClient namespace, so you will need to add a using statement at the top of your code if you want to instantiate a SQLBulkCopy instance. Although my project will only really involve XML data with a max of about 2,000 elements I’ve done a bit of reading about some of the performance benefits some .net developers are getting by using SQLBulkCopy, a couple of people said they were writing 40-50K XML elements (how big were the elements though?) to their DB in only a few seconds, now that’s quick… it sure beats looping over ‘insert into’ statements.

Resources:
http://dotnetslackers.com/Articles/ADO_NET/SqlBulkCopy_in_ADO_NET_2_0.aspx
http://www.sqlteam.com/article/use-sqlbulkcopy-to-quickly-load-data-from-your-client-to-sql-server

HOME | ABOUT US | CONTACT US | SITEMAP | GOOGLE SITE SEARCH | TOP
12 Lorcan Crescent, Santry, Dublin 9, Ireland +353 87 9807629