Click here to Skip to main content
15,216,187 members

Comments by Dave Kerr (Top 28 by date)

Dave Kerr 14-Feb-13 3:26am View
Of course! But I think the project is useful and will be helpful for those looking over this question in the future :)
Dave Kerr 8-Feb-13 8:51am View
If you are unable to deploy via web deploy (which can be a pain to configure), have you tried creating the web application and virtual director on the remote server, then enabling FTP and using FTP to deploy the site?

Surprisingly enough, this can also be quite tricky to set up. Why not give it a try and let me know if you have specific problems with it. This would get you up and running and take the stress off getting web deploy working
Dave Kerr 11-Dec-12 8:09am View
Thanks for the update, but actually I was wondering about the possibility of installing the IIS component automatically as part of say for example an Installshield Installation.
Dave Kerr 17-Nov-11 11:08am View
I think this will make sense - there's nothing *wrong* with what is created by default, all I need to do is add a few functions and an event handler, so augmenting what is created with an addition to the partial class would be just right - I suppose I could even write a Visual Studio addin to allow the augmentation to be invoked via a menu option or something. Thanks for the information!
Dave Kerr 17-Nov-11 10:17am View
I've updated the question :)
Dave Kerr 3-Nov-11 8:44am View
Thanks for this idea, I will look into creating content types for the assets for the customers and then a view for each customer, thanks for the feedback :)
Dave Kerr 3-Nov-11 8:44am View
Those are some very useful links, I think that they suggest that sub-sites per customer may not be appropriate in this case, along with Mark's solution below it looks like views per customer may be they way to go. I will continue with the research!
Dave Kerr 24-Oct-11 11:59am View
no probs - I get email notifications so I keep track of comments if you need to update the question ;)
Dave Kerr 24-Oct-11 10:04am View
In this case if the code works do it without, mention however that in more advanced scenarios you should use the stencil buffer to clip the reflecting plane (or the geometry of the reflecting surface). IF this helps out can you flag the solution as a correct answer :)
Dave Kerr 24-Oct-11 9:25am View
Try removing the stencil buffering options and see if it still works - it may be that you've inherited this code from an example that used the stencil buffer but doesn't any more. Typically it would be used to draw a stencil of the reflective surface so that the reflection when drawn is only drawn on the reflective surface - avoiding reflections that don't get 'cut off' when the mirror they are in ends.
Dave Kerr 24-Oct-11 5:46am View
No probs, I've updated the solution with an example, centralized 1024x768 div.
Dave Kerr 13-Oct-11 14:16pm View
MS Access 2000: Table designer, choose the column and make sure 'Required' is set to 'No' - then you can use an int or a blank value (null!). If you have problems commiting - try using DBNull in the code :)
Dave Kerr 13-Oct-11 11:24am View
Right, well you do not use the index or primary key for this - if the primary key changes then it's not a key and it'll break database relationships. You need to add an extra column called 'row number' and keep this up to date yourself - if you delete a record with row number x, you must decrement every row number > x.

Why do you need the row number? It is generally not a sensible thing to store in a database, because the more records you have, the more processing is required to keep the row number up to date, this is a maintainance nightmare.

but this will only number the results of a query. Are you sure you need the row number exactly? what are you using it for?
Dave Kerr 13-Oct-11 11:14am View
IT will indeed give a commit error - null is not a valid value for an integer.
Do you want it to be hidden if it is zero? Because this is entirely different!
If you need null as a value, you'll need to change your database to allow the column to be nullable.
Dave Kerr 13-Oct-11 9:26am View
An index doesn't have anything to do with deleted rows - it's just used as a unique key for rows in a table, only adding new rows needs to update the index - what are you expecting to happen when the row is deleted?

Row Number Index Example Column
1 1 Dogs
2 2 Cats
3 3 Fish

If you delete row 2, the indexes are (in order)
Row Number Index Example Column
1 1 Dogs
2 3 Fish

The indexes mustn't change! If they did, then anything that was using the index as a key (for example 'PetOwner' table has link to the table above) would be broken (e.g. a PetOwner of a Fish now owns something different!)

What is it exactly that you want the index to do? You can't use it as the 'number' of the row!
Dave Kerr 13-Oct-11 6:39am View
Use these attributes in the XAML datagrid definition:

EnableRowVirtualization="True" EnableColumnVirtualization="True"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
Dave Kerr 13-Oct-11 4:39am View
Can you please tell us what the coil is in this context?
Dave Kerr 12-Oct-11 15:54pm View
Cool glad you've got it working :)
Dave Kerr 12-Oct-11 12:31pm View
I'll help just on my way home from work at the moment tho!
Dave Kerr 12-Oct-11 11:39am View
I noticed you posted that this wasn't working - we'll need more details to give you a better answer - what exactly does your data list contain?

If you provide code and more detail you're much more likely to get a decent answer ;)
Dave Kerr 12-Oct-11 6:21am View
That's more correct yes, although the post says he has 100 records using TOP 50 PERCENT is safer and will work when the number of records changes.
Dave Kerr 5-May-11 10:36am View
Perfect, thank you!
Dave Kerr 6-Apr-11 12:02pm View
As an addendum, in most real-world applications the saving of a few clock cycles here and there through the way objects are allocated is negligent - the best approach to improve performance is to look at issues that cause bottlenecks:

* Disk Access
* Database transactions
* Manipulation of large data (images etc)
* Rendering of images

and so on - however, using the profiler is a good way to show where the bottlenecks are - it'll show you which functions are being spent the longest in and which areas can be improved.
Dave Kerr 6-Apr-11 11:55am View
For sure, although you'll need the right version of visual studio (Ultimate or Premium).

The task you are looking at is known as 'profiling', which involves running the application whilst visual studio (or another profiling tool) gathers low level data about how the CPU is being hit.

It's a complicated area, so the best I can do is suggest looking at:

and taking it from there :) Good luck!
Dave Kerr 6-Apr-11 10:12am View

OK, to each data member that is an object type we get 32 bits allocated (on a 32 bit system) or 64 bits allocated (on a 64 bit system). For each value type, we get the size of the value type. Therefore:

class something
string str1;
string str2;
string str3;
Int64 int1;

will give us 3 x 4 bytes for the strings (internally stored as a pointer to the string, i.e a memory address) and 64 bits (8 bytes) for the Int64. So we can roughly estimate this class will take up 20 bytes on the heap.

However, take a look at the class below:

class parent
someclass child1;
someclass child2;

In this case the someclass members are objects, so although each on takes up ~ 20 bytes the parent class needs only 8 bytes - enough to store two pointers.
creating an instance of parent takes up at least 8 bytes - even if the someclass members are not initialised.

in terms of time taken, the clock cycles used to allocate the memory are very few - allocating and freeing memory is generally a rapid operation.

we ourselves cannot enhance the speed of the compiler (it is very fast anyway) but you can certainly enhance the speed of the program by following some guidelines:

* create child classes only when needed. in the case of 'parent' above, don't created child1 and child2 in the constructor - create them only when required.
* make (very) small classes structures. if we have the class 'vector'
class vertex
int x;
int y;
int z;
it is so small (~12 bytes) that the saving in storing as a pointer (12-4 = 8 bytes) is very small - if we're doing lots of work with vertex objects, manipulating, copying, passing them around, we will in general be faster defining them as 'structures' so that they are copied by value (i found this out the hard way with a c# openGL port).

also look into 'boxing' and 'unboxing' - there is an overhead in converting a value to an object and vice versa, i.e.

function(object o)

int i = 0;

in this case we have to 'box' i (which is a value) into an object to be passed to function.
Dave Kerr 5-Apr-11 11:37am View

I think understanding the concept of 'Inversion of Control' is crucial to this problem and other areas in general, so reading about this to get a better theoretical understanding would certainly be wise.

Also, as you mention it seems that there are mechanisms to do this in a low level way (TcpClient/TcpListener) as well as a more high-level way (self hosted services) - the requirements can determine the mechanism used, but the design should be handled after a thorough review of the requirements is made.

With these comments and the solution above I think I have plenty to go on - thank you very much for your help :)
Dave Kerr 17-Nov-10 9:19am View
Thanks Richard, this is exactly the information I needed :)
Dave Kerr 5-May-10 7:45am View
Hi Christian,

The XML is always created on windows, but might be stored on a unix machine, so the newlines thing shouldn't be a problem - setting up a unix server is what i'll do next, just wanted to get a rough idea of whether i'd be banging my head against a brick wall!