Monday, 17 January 2011

SQL ParseName operator function


SQL ParseName operator

Returns the specified part of an object name. The parts of an object that can be retrieved are the object name, owner name, database name, and server name.

 

Note

The PARSENAME function does not indicate whether an object by the specified name exists. PARSENAME just returns the specified part of the specified object name.

 

 

SELECTPARSENAME('myserver.AdventureWorks2008R2.dbo.Person', 1)
AS
'Object Name';

SELECT
PARSENAME('myserver.AdventureWorks2008R2.dbo.Person', 2)
AS
'Schema Name';

SELECT
PARSENAME('myserver.AdventureWorks2008R2.dbo.Person', 3)
AS
'Database Name';

SELECTPARSENAME('myserver.AdventureWorks2008R2.dbo.Person', 4)
AS
'Server Name'

Effective Clustered Indexes





For effective clustered indexes, follow the few basic points below.

  • Narrow – as narrow as possible, in terms of the number of bytes it stores
  • Unique – to avoid the need for SQL Server to add a "uniqueifier" to duplicate key values
  • Static – ideally, never updated
  • Ever-increasing – to avoid fragmentation and improve write performance

For full detailed explaination, read
http://www.simple-talk.com/sql/learn-sql-server/effective-clustered-indexes/?utm_source=simpletalk&utm_medium=email-main&utm_content=EffectiveIndex-20110110&utm_campaign=SQL

Sunday, 16 January 2011

Windows 7 Starter - creating a Virtual PC with Virtual Box (VirtualBox)

After several attempts to tweak my netbook that's running Windows 7 Starter, so that it can have some sort of Windows XP environment, I was pointed in the direction of VIRTUALBOX.

It's a free application that create's a Virtual PC machine on the host machine.
I mounted it with my image of my Windows XP installation disk, and it installed without many issues, EXCELLENT !

Just what the doctor ordered.

Check it out.
http://www.virtualbox.org/

Run Windows Virtual PC (XP Mode or VM) With No Hardware Virtualization

In my recent attempts to set up my windows 7 netbook with an windows XP partition, I stumbled across the following interesting article on using a virtual pc to achieve what I was after.

Windows 7 Virtual PC and Windows XP Mode Official Direct Download Links
Download KB977206 to Run Windows Virtual PC (XP Mode or VM) With No Hardware Virtualization
Seems like a less painful way of achieving my goal !!!

For tips on windows virtual pc, try:
  • http://download.microsoft.com/download/7/D/6/7D686A6A-B0F7-42E5-BB3B-4972A8C42C9F/Windows%20Virtual%20PC%20Tips.pdf
or
  • http://download.microsoft.com/download/A/1/7/A17D0058-EF7E-43B5-A615-711A3F4C46E7/VirtualPC_Eval_Guide.doc

Saturday, 15 January 2011

[EXCEL] Gantt Charts

Making a Gantt Chart


in Excel 2007 is another excellent resource for creating Gantt Charts in Excel.

The 7-minute video above gives you step-by-step instruction on how to use the built-in chart tool in Excel 2007 to create a Gantt chart.

If you need more help, check out this article by Michele McDonough Using Excel to Create a Gantt Chart.

BrightHub Gantt Chart link

Excel Gantt

[EXCEL] Shade Alternate Rows in Excel 2007

One way to quickly add shading to alternate rows in Excel 2007 is by applying a predefined table style.


By default, shading  is applied to alternate rows in an Excel 2007 table to make the data easier to read.


The alternate row shading will remain accurate even if you add or delete rows.


 
  • Select the range of cells you want to format
  • On the Home tab, in the Styles group, click Format as Table
  • Under Light, Medium, or Dark, click the table style you want to use
  • In the Format as Table dialog box, click OK.
    Notice that the Banded Rows check box is selected by default in the Table Style Options group.
    To apply shading to alternate columns instead of alternate rows, clear this check box and select Banded Columns
  • If you want to convert the Excel table back to a regular range of cells, click anywhere in the table to display the tools necessary for converting the table back to a range of data
  • On the Design tab, in the Tools group, click Convert to Range

Nigella Lawson Gluten free and Dairy free Venetian Carrot Cake

http://www.bbc.co.uk/food/recipes/gluten-free_and_11807





By Nigella Lawson


From Nigella Kitchen

Preparation time : Less than 30 mins

Cooking time : 30 mins to 1 hour

Serves 8-10


Ingredients

For the carrot cake


For the mascarpone cream (optional)


Preparation method


  1. For the carrot cake, preheat the oven to 180C/350F/Gas 4. Line the base of a 23cm/9in round springform cake tin with re-usable non-stick silicone liner or baking parchment and grease the sides with olive oil.
  2. Toast the pine nuts by browning in a dry frying pan; the oven alone is not enough to scorch out the paleness. Set aside.
  3. Grate the carrots in a processor (for ease) or with a coarse grater, then sit them on a double layer of kitchen paper and wrap them, to soak up excess liquid. Set aside.
  4. Put the golden sultanas in a small saucepan with the rum, bring to the boil, then turn down and simmer for 3 minutes.
  5. Whisk the sugar and oil until creamily and airily mixed.
  6. Whisk in the vanilla extract and eggs and, when well whisked, fold in the ground almonds, nutmeg, grated carrots, golden sultanas (with any rum that clings to them) and, finally, the lemon zest and juice.
  7. Scrape the mixture into the prepared cake tin and smooth the surface with a rubber spatula. The batter will be very shallow in the tin.
  8. Sprinkle the toasted pine nuts over the cake and put it into the oven for 30–40 minutes, or until the top is risen and golden and a skewer inserted into the centre comes out sticky but more or less clean.
  9. Remove from the oven and let the cake sit in its tin on a wire rack for 10 minutes, then unspring and leave it on the rack to cool.
  10. For the mascarpone cream, mix the mascarpone with the icing sugar and rum.
  11. To serve, transfer the cake to a plate. Put the mascarpone cream in a bowl to spoon alongside the cake, for those who want.

Nigel Slaters Black banana cake

http://www.bbc.co.uk/food/recipes/black_banana_cake_52982

 


By Nigel Slater

From Nigel Slater's Simple Suppers

preparation time : Less than 30 mins

cooking time : 1 to 2 hours

Serves at least 8

 

 

Want to know how to use up overripe bananas?

Nigel Slater's banana bread recipe is just the ticket.

 

 

Ingredients

  • 175g/6oz unsalted butter, softened
  • 175g/6oz sugar (half light muscovado, half golden caster)
  • 75g/2½oz hazelnuts
  • 2 free-range eggs
  • 175g/6oz self-raising flour
  • 2 very ripe bananas (about 250g/9oz total weight)
  • drop vanilla extract
  • 175g/6oz good-quality dark or milk chocolate chips
  • a little demerara sugar

     

     

Preparation method

  • Preheat the oven to 170C/325F/Gas 3. Line the base and sides of a 20cm x 12cm/8in x 5in loaf tin with baking parchment.
  • Beat the butter and sugars until light and coffee-coloured. This is best achieved in a food mixer.
  • Toast the hazelnuts, rub them in a tea towel to remove their skins, then grind quite finely.
  • Slowly add the eggs to the butter and sugar mixture, then mix in the toasted ground hazelnuts and self-raising flour.
  • Peel the bananas and chop them the small pieces. Gently fold the vanilla extract, the bananas and the chocolate chips into the cake mixture, turning gently and taking care not to overmix.
  • Scoop the cake batter into the prepared loaf tin. Dust with a little demerara sugar. Bake for between 1 hour and 1 hour 10 minutes, covering the cake with foil if the top starts to darken too quickly.


 

HTC Desire HD Battery Life information

This is a post to make a note of the http://hemorrdroids.net website.

 

The links of particular interest that relates to battery life is:

http://hemorrdroids.net/htc-desire-hd-battery-life/

 

 

To recondition the battery so that the battery gauge is more accurate, and that you get the most from the battery is:

http://hemorrdroids.net/battery-calibration/

 

The command to remove the battery file is step 6 in the above page:

  1. **Root users only** Using a Terminal Emulator, type "su" enter, followed by "rm /data/system/batterystats.bin"

3 Fundamental Questions about Data Marts...and Their Answers

By Denise Rogers

http://www.databasejournal.com/features/article.php/3913826/3-Fundamental-Questions-about-Data-Martsand-Their-Answers.htm

 

A data mart provides the primary access to the data stored in the data warehouse or operational data store.

It is a subset of data sourced from the data warehouse or operational data store specifically focused on a business function or set of related business functions.

 

We did it! We built the data warehouse, we created the ETL framework, we identified the data sources, we even created the metadata repository and the ODS; so now we have received a request to build a data mart. The business users want to be able to access data in this great data warehouse. They spent a significant amount of time, resources and patience to build a data warehouse environment that would stand the test of time and they want to be able to get their money's worth.

So how do we start? Better yet, where do we start? I think a good place to start is to understand what a data mart is.

  • So what is a data mart?

Well, through the business intelligence framework, a data mart provides the primary access to the data stored in the data warehouse or operational data store.

It is a subset of data sourced from the data warehouse or operational data store specifically focused on a business function or set of related business functions.

 

 

  • What is the purpose of a data mart?

The fact is : the data warehouse is a repository of centralized, cleansed, standardized, transformed and integrated historical data.

It is the organizational view of its business from a data perspective.

However, it is an extremely difficult task to access or report on data within a data warehouse.

  • The data in a data warehouse is organized by subject area; it's historical and represents the organization as a whole.
  • In the same way the operational data store (ODS) has the characteristics of the data warehouse with the most important exception that the data in an ODS is NON-HISTORICAL.

Think of what that set of SQL statements would look like to accomplish this task!

Lots of complex joins!

Performance degradation related to the volume of data that must be read to satisfy the criteria in the SQL statements! Phew.

 

That's where the data mart serves a purpose.

It provides the business unit with easy access to data in the warehouse or the operational data store.

 

Why?

  • Because the data in the data mart is specifically tailored to the business unit.
  • It is organized based on specific business requirements.
  • The primary purpose for its existence is to support data dependent business functions related to reporting, trending, analysis and presentation.
  • Are there types of data marts?

Data marts are created to support the needs and requirements of the business unit.

These requirements are the driving force behind the type of data mart built.

So let's take a look at some of the common and fundamental business requirements and the type of data mart that works well with the solution.

The most common of data mart types is the star schema data mart.

A star schema is a fact table and a set of dimension tables and the relationships between the two sets.

 

What is a fact table?

A fact table is a set of metrics or measures generated that relates to a specific business process or event.

 

An example of a fact table is "Claims Paid Large Amount for Marine Craft".

This fact table is exactly what it says; it contains claims paid in certain amounts for marine policies on marine craft.

 

A dimension table is a set of elements that describe the event of metrics in the fact table.

A dimension table contains the attributes that places the metrics in the fact table into a particular context.

 

An example of a dimension table is Accident State.

Star schema data marts are simple and very cost effective to deploy and provide multidimensional functionality within a relational database.

Its design lends itself best to trend and historical reporting and is supported by most DBMSs including SQL Server, UDB and Oracle.

 

A snowflake schema data mart is a star schema with dimension tables that have been normalized.

This type of data mart works best in situations where dimension tables are too large (most of the columns in the dimension table are populated with data values) or too sparse (few data values in columns of the dimension tables.

A snowflake schema will have the fact table; however, the dimension tables may have parent tables that they are related to.

This design enables the efficient use of storage, as there is a significant reduction in data redundancy.

However, maintenance is more complicated as there are more tables to populate and synchronize.

A snowflake schema works well where the dimensions are not clearly defined.

 

A data or OLAP cube is a very interesting solution.

It is a multidimensional database that is specifically architected to support all flavors of reporting including analytics, trending and historical reporting.

It is organized into measures (facts) and dimensions.

However, this type of database is optimized to report on data from different views and perspectives.

It provides the ability to slice and dice, drill through to atomic detail and discover patterns in data.

A data or OLAP cube is best suited for solutions where efficient reporting with complex business requirements is mandatory.

It works best with sophisticated business intelligence tools that possess features and functionality that enables reporting from cubes.

Software solutions such as Business Objects, Cognos, Hyperion and SQL Server Analysis Services (SSAS) are perfect examples here.

However, the design, maintenance and processing of the cube should not be under estimated.

The cube build itself is quite resource intensive, therefore requires robust hardware and software designed for this type of workload. Trust me on this one. I have worked on reporting applications where the cube build process would fail at least once a week! Why? For a couple of reasons, the first being the design of the some of the measures and the capacity of the server, including limited memory and processing power.

 

  • Are there Design Rules for Data Marts?

In terms of design rules for an OLAP cube, a set of fundamentals hold true.

Here are a few that I would like to share.

 

  1. Based on the business requirements, the team, through careful analysis, must identify the sources that will be used to build the cube.

    Ideally the subject area from a data warehouse or ODS should be sufficient as it contains the entire organization's data assets.

  2. Design the dimensions carefully and appropriately.

    They are an extremely important part of the data mart solution as they provide the context for the metrics in the fact table.

    Use conformed dimensions wherever possible.

    A conformed dimension is an entity where its definition is shared among business units.

    An example of this is geographic region dimension.

    There is only one set of states in the United States of America; this should be a common or shared definition of geography.

Lastly, remember, "Just say no to nulls".

A data mart is a subset of data from a data warehouse.

This data is a recording of events that occurred from sets of business transactions.

These transactions all have valid data values that are something other than nulls, zeroes or spaces.

So therefore, the data mart should be a reflection of that.

One Last Thing

A data mart is the mechanism through which the business community can access and view the data that has been transformed and enriched from a number of transactional systems across the enterprise into a holistic view of the organization's data assets.

Care must be taken in designing an appropriate solution that

  • aligns to business requirements
  • and the strategic direction of the organization at large.

Android – HTC Desire HD BootLoader, HBOOT

I'm not entirely sure on the fully purpose of this, but it's possible to perform a FACTORY RESET when accessing the BootLoader / HBOOT screen.

 

A quick note:

FOLLOWING THESE INSTRUCTIONS IS ENTIRELY AT YOUR OWN RISK – these notes are purely for my own reference.

 

BootLoader / HBOOT

On my desire HD – to enter the BootLoader / HBOOT screen, perform the following steps.

  1. Remove the battery to reset the phone (you'll loose temporary data stored in the RAM)
  2. Re-insert the battery and PRESS AND HOLD the VOLUMN DOWN button and then also press the POWER button
  3. After a few seconds, a white screen with three ANDROID figures on the bottom of the screen will appear

In this BootLoader / HBOOT screen, you have several options – most of which I currently do not understand, but will update accordingly.

One of the options is FACTORY RESET.

To select this, use the UP and DOWN VOLUMN buttons to change the option, and press the POWER button to select the option.

 

During RECOVERY, and FACTORY RESET, pressing the VOLUMN UP + POWER button combination shows some debugging text / options – again, which I'm not entirely sure of.

Android – HTC Desire HD SAFEMODE

Lifted from http://www.techcredo.com/android/how-to-start-your-android-phone-in-safe-mode-how-to-get-out-of-a-force-close-loop

Android's SAFEMODE is similar to Windows SAFEMODE.

Booting a device into safemode means that only the essential apps are running.

This may be needed if the device is caught within a FORCE CLOSE LOOP.

A 'force close loop' is when an unstable application is involuntary closed by the system, and then it's automatically launched again, then closed, and this goes on and on, and prevents you from accessing any of Android's menus to kill the loop.

 

SAFEMODE

On my desire HD – to enter the SAFEMODE, I performed the following steps:

  1. Remove the battery to reset the phone (you'll loose temporary data stored in the RAM)
  2. Re-insert the battery and press the POWER button
  3. As soon as the first HTC icon appears, PRESS AND HOLD the VOLUMN DOWN button till the device fully loads

Once the phone has completely switched on, you'll see a transparent SAFEMODE watermark in the lower left hand corner of the screen.

HTC Battery Life – possible trick

I'll need to confirm this but I've just found on the web (via an anonymous post) that you can almost "double"..... battery life.....

 

I highly doubt this, but it's worth a punt.

  1. Turn your device ON and Charge the device for 8 hours or more
  2. Unplug the device and Turn the phone OFF and charge for 1 hour
  3. Unplug the device Turn ON wait 2 minutes and Turn OFF and charge for another hour

Seems like allot of "faffing" so I'll need to confirm this.

Man making realistic car sounds with his mouth !!!!! Soo funny !

North Wales Traffic Camera images, from the BBC

Deals – Dine in for £10 at Marks and Spencer, 13th to 18th January 2011

Dine In for Two. £10
Menu. Choose from a selection of Main Meal, Side Dish, Dessert, and Bottle of Wine, all for £10
Thursday 13 – Tuesday 18 January


Main Meal, Side dish, Dessert, Bottle of Wine for £10

MAINS
• The Cook Menu Chicken with Brie & Bacon
• The Cook Menu Spiced Rosti Chicken
• The Cook Menu Beef Meatballs with Tomato Sauce
• The Cook Menu Cajun Chicken Stuffed Parcels
• The Cook Menu Goats Cheese & Pesto En Croute (V)
• Whole Trout with Sundried Tomato & Basil Butter
• Gastropub Cottage Pie
• Gastropub Moussaka
• Rotisserie Chicken
• Ready To Roast Gammon Joint
• Sweet & Smokey Chicken
• Beef Lasagne

SIDE DISHES
• New Potatoes
• Fresh Chips
• Farmhouse Crispy Potato Wedges
• Potato & Leek Bake (NEW)
• Ultimate Potato Mash
• Rosemary Potatoes
• Traditional Vegetables for Roasting
• Green Pea, Bean & Vegetable Layer
• Broccoli, Carrot & Sugar Snap Peas
• Broccoli & Carrots
• Petit Pois & Carrots
• Garlic Mushrooms

DESSERTS
• 2 Crème Brûlées
• 2 Tarte au Citron Slices
• Tiramisu Traybake
• 2 Strawberry Cheesecake Slices
• Puff Pastry Apple Pie
• Key Lime Pie Mini Shots
• 2 Raspberry Panna Cottas
• 2 Millionaires Shortbread Slices
• Strawberry Trifle
• 2 Lemon & Ricotta Cheesecake Slices
• After Dinner Mint Selection
• Dine In Cheese Selection

WINES & DRINKS
• Raso de la Cruz Rosé
• Gascogne Rosé
• Gascogne White
• Cape Quarter Rosé
• Gaston de Veau Merlot
• Gaston de Veau Chardonnay
• Raso de la Cruz Macabeo
• Raso de la Cruz Cabernet Sauvignon
• Italian Zinfandel Rosé
• Ke Sauvignon Blanc
• Ke Cabernet Sauvignon
• House Rosé
• Irish Coffee (Twin Pack)
• Apple Soft Brew
• Valencia Orange Juice (Twin Pack)
• Elderflower Presse (Twin Pack)