Search Results

Search found 5 results on 1 pages for 'ragesh'.

Page 1/1 | 1 

  • Windows 7 RC sleep on Thinkpad R51?

    - by Ragesh
    I have an old Thinkpad R51 and Windows 7 just doesn't give me a Sleep option. I suspect it's because it's running the default VGA driver. The machine has an Intel 855 GME graphics adapter but there doesn't seem to be a WDDM driver available publicly. Lenovo's driver download page just says that drivers for Vista are bundled with the OS. Apparently, they aren't bundled with Windows 7 as it always defaults to a generic VGA driver. Is there a reliable way to get Sleep to work on this machine?

    Read the article

  • How does "Require SSL" affect ASP.NET MVC application lifecycle?

    - by Ragesh
    I have an application that taps into BeginRequest and EndRequest to set up and tear down NHibernate sessions like this: BeginRequest += delegate { CurrentSessionContext.Bind(SessionFactory.OpenSession()); }; EndRequest += delegate { var session = CurrentSessionContext.Unbind(SessionFactory); session.Dispose(); Container.Release(session); }; This works fine when deployed in IIS, until I check the "Require SSL" box. Once I do this, I get a NullReferenceException at session.Dispose(). I haven't debugged this yet and, yes, the fix is trivial, but I'm just curious about how "Require SSL" affects the lifecycle of a request. Is a session not set up on the server in these cases?

    Read the article

  • How do I make this ASP.NET MVC controller more testable?

    - by Ragesh
    I have a controller that overrides OnActionExecuting and does something like this: protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); string tenantDomain = filterContext.RouteData.Values["tenantDomain"] as string; if (!string.IsNullOrWhiteSpace(tenantDomain)) { using (var tx = BeginTransaction()) { this.Tenant = repo.FindOne(t => t.Domain == tenantDomain); } } } Tenant is a protected property with a private setter. The class itself is an abstract base controller that my real controllers derive from. I have code in other controllers that looks a lot like this: if (Tenant == null) { // Do something } else { // Do something else } How do I test this code? What I need to do is to somehow set the Tenant property, but I can't because: It's a protected property, and It has a private setter Changing the visibility of Tenant doesn't "feel" right. What are my alternatives to unit test my derived controllers?

    Read the article

  • Generics and reflection in Java

    - by Ragesh
    This is probably a very basic question, but I'm really new to generics in Java and I'm having a hard time altering my thought process from the way things are done in C#, so bear with me. I'm trying to build a generic repository in Java. I've created an IRepository interface that looks like this: public interface IRepository<T extends IEntity> And a Repository class that looks like this: public class Repository<T extends IEntity> implements IRepository<T> Now, from within the constructor of my Repository class, I'd like to be able to "divine" the exact type of T. For example, if I instantiated a repository like this: IRepository<MyClass> repo = new Repository<MyClass>(); I'd like to know that T is actually MyClass. This is trivial in C#, but obviously generics are a totally different beast in Java and I can't seem to find anything that would help me do this.

    Read the article

  • Why does DeviceIoControl throw error 21 (Device Not Ready) from C# when the equivalent in C works fine?

    - by Ragesh
    I'm trying to send an IOCTL_SERVICE_REFRESH command to the GPS Intermediate Driver service using C# like this: handle = CreateFile("GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero); if (handle.ToInt32() == INVALID_HANDLE_VALUE) { rc = Marshal.GetLastWin32Error(); return rc; } int numBytesReturned = 0; rc = DeviceIoControl( handle, IOCTL_SERVICE_REFRESH, null, 0, null, 0, ref numBytesReturned, IntPtr.Zero); int error = Marshal.GetLastWin32Error(); GetLastWin32Error always gives me error 21 (device not ready). However, the equivalent call when made from C++ works fine: HANDLE hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hGPS != INVALID_HANDLE_VALUE) { BOOL ret = DeviceIoControl(hGPS,IOCTL_SERVICE_REFRESH,0,0,0,0,0,0); DWORD err = GetLastError(); } I suspected a problem with the PInvoke signatures, but I can't seem to find anything wrong here: [DllImport("coredll.dll", EntryPoint = "DeviceIoControl", SetLastError = true)] public static extern int DeviceIoControl( IntPtr hDevice, uint dwIoControlCode, byte[] lpInBuffer, int nInBufferSize, byte[] lpOutBuffer, int nOutBufferSize, ref int lpBytesReturned, IntPtr lpOverlapped); [DllImport("coredll.dll", SetLastError = true)] public static extern IntPtr CreateFile( String lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr attr, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); What am I missing here?

    Read the article

1