Windows XP/2k3 and earlier (can't attest to Vista, but suspect it's the same) all appear to become more sluggish over time as applications are installed and uninstalled.
This is not a scientifically tested observation, but more of a learned-through-experience piece of wisdom. (I've always suspected the registry as being behind the issue.)
Does anyone have any concrete evidence of this degradation occurring, or it just an invalid perception of mine?
I frequently connect to my workplace over a VPN. I would like to continue watching videos from, say YouTube, whilst I work on the VPN, without degrading the available VPN bandwidth (say for an RDP session).
Can I configure a second NIC to deal with only the VPN traffic, with everything else going over the primary?
Specs as requested: Macbook Pro, OSX Snow Leopard, using the built in OSX VPN connectivity, the in-built airport card and a USB external wifi adapter.
When I perform an action that is not valid in a given context, like attempting to type when a text area does not have the focus I hear a beep, which is very distracting when wearing headphones. How can I disable this?
I am not sure how to reproduce this as it only happens under certain circumstances which I have not yet nailed down.
When reading in a 3rd party RSS feed an XMLException is thrown due to an invalid DateTime in the feed XML.
How can I handle this more robustly. For example, is there a way to catch the exception, identify the problematic element and deal with it?
My web-app is hosted on mydomain, with the following URI associated with the domain: blah.net.
I can login to using either of the following usernames:
mydomain\ben
[email protected]
What are the names of each of these types of login (and are there any differences), within the context of Windows Authentication?
I have an interface IUserLocation and a concrete type UserLocation.
When I use ICriteria, specifying the interface IUserLocation, I want NHibernate to instantiate a collection of the concrete UserLocation type.
I have created an HBM mapping file using the table per concrete type strategy (shown below). However, when I query NHibernate using ICriteria I get:
NHibernate cannot instantiate abstract class or interface MyNamespace.IUserLocation
Can anyone see why this is? (source code for the relevant bit of NHibernate here (I think))
My ICriteria:
var filter = DetachedCriteria.For<IUserLocation>()
.Add(Restrictions.Eq("UserId", userId));
return filter.GetExecutableCriteria(UoW.Session)
.List<IUserLocation>();
My mapping file:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true">
<class xmlns="urn:nhibernate-mapping-2.2" name="MyNamespace.IUserLocation,MyAssembly" abstract="true" table="IUserLocations">
<composite-id>
<key-property name="UserId" column="UserId" type="System.Guid"></key-property>
<key-many-to-one name="Location" column="LocationId" class="MyNamespace.ILocation,MyAssembly"></key-many-to-one>
</composite-id>
<union-subclass table="UserLocations" name="MyNamespace2.UserLocation,MyAssembly2">
<property name="IsAdmin" />
</union-subclass>
</class>
</hibernate-mapping>
I am working with Active Directory using C#. Instantiating the PrincipalContext object seems to be expensive, so I'd like to store one in a class variable.
When using PrincipalContext as a local variable, I can use the convenient using syntax. When storing an IDisposable object in a static variable, how do I ensure the object is properly disposed of?
I'd like to improve my understanding of cardinality constraints in ER diagrams.
I have two entities:
User
Location
But, I want the relationship between these two entities to be many-to-many (a user can be in many locations and a location can have many users).
To do this I need to introduce an association class UserLocation.
Is it correct to say I now have 3 entities?
If I were to draw an ER diagam of the above, would I draw in the UserLocation entity, and would the cardinality look like this?
User 1 ------ * User Location * ------ 1 Location
When I subscribe as the recipient of a certain type of message using NServiceBus
Bus.Subscribe<MyMessage>()
What am I actually doing? Am I specifying that a particular method on the recipient type will be invoked upon message receipt? If so, within what context does the method run - in a static context, or within the context of a new'd-up parent class instance (and if so, how does NServiceBus know what constructor to use)?
How can I use an object initializer with an explicit interface implementation in C#?
public interface IType
{
string Property1 { get; set; }
}
public class Type1 : IType
{
string IType.Property1() { get; set; }
}
...
//doesn't work
var v = new Type1 { IType.Property1 = "myString" };
I have a simple inheritance heirarchy with MyType2 inheriting from MyType1.
I have an instance of MyType1, arg, passed in as an argument to a method. If arg is an instance of MyType2, then I'd like to perform some logic, transforming the instance. My code looks something like the code below.
Having to create a new local variable b feels inelegant - is there a way of achieving the same behavior without the additional local variable?
public MyType1 MyMethod(MyType1 arg)
{
if(arg is MyType2)
{
MyType2 b = arg as MyType2;
//use b (which modifies "arg" as "b" is a reference to it)...
}
return arg;
}
In my experience, web.config files are widely reviled. In particular, I have found them difficult to manage when you have multiple environments to support, and fiddly to update due to the lack of validation at update-time and the verbosity of XML.
What are the alternatives?
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to the windows event log. The other doesn't.
Is there a setting in IIS or the web.config to enable event log logging?
Apologies for the broad question, I'm really looking for avenues for investigation.
I'd like to program against interfaces when working with NHibernate due to type dependency issues within the solution I am working with.
SO questions such as this indicate it is possible.
I have an ILocation interface and a concrete Location type. Will the following work?
HBM mapping:
<class name="ILocation" abstract="true" table="ILocation">
<id name="Id" type="System.Guid" unsaved-value="00000000-0000-0000-0000-000000000000">
<column name="LocationId" />
<generator class="guid" />
</id>
<union-subclass table="Location" name="Location">
<property name="Name" type="System.String"/>
</union-subclass>
</class>
Detached criteria usage using the interface:
var criteria = DetachedCriteria.For<ILocation>().Add(Restrictions.Eq("Name", "blah"));
var locations = criteria.GetExecutableCriteria(UoW.Session).List<ILocation>();
Are there any issues with not using the hilo ID generator and/or with this approach in general?
For the purposes of setting a value in Active Directory I would like to convert a long to an unsigned 8-byte integer, for assignment to an AD property.
How can I do this?
Are there any circumstances where it is favourable to manually create a stub type, as opposed to using a mocking framework (such as Rhino Mocks) at the point of test.
We take both these approaches in our projects. My gut feel when I look at the long list of stub versions of objects is that it will add maintenance overhead, and moves the implementation of the stub away from the point of test.
I want to set the LastPasswordSet attribute of a user in Microsoft Active Directory.
The .NET UserPrincipal API exposes the LastPasswordSet property as readonly.
Is there a way around this, to set the value (perhaps using ADSI)?
You can specify the namespace and assembly to use types from at the top of HBM files:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="MyCorp.MyAssembly" namespace="MyCorp.MyAssembly.MyNamespace">
Can you use types from multiple assemblies / namespaces within the same mapping file, and if so what is the syntax for doing so?
Windows XP/2k3 and earlier (can't attest to Vista, but suspect it's the same) all appear to become more sluggish over time as applications are installed and uninstalled.
This is not a scientifically tested observation, but more of a learned-through-experience piece of wisdom. (I've always suspected the registry as being behind the issue.)
Does anyone have any concrete evidence of this degradation occurring, or it just an invalid perception of mine?
I'd like two websites to have read/write access to the same user profile database (named "aspnetdb" by default). Presumably this is possible by configuring the websites appropriately in the web.config. Are there any issues I should be wary of?