Java Scala interop: transparent List and Map conversion

Trust me; you don’t want transparent conversion back and forth. This is precisely what the scala.collection.jcl.Conversions functions attempted to do. In practice, it causes a lot of headaches. The root of the problem with this approach is Scala will automatically inject implicit conversions as necessary to make a method call work. This can have some … Read more

Using C/inline assembly in C#

It’s actually very easy and does not even require reflection. [SuppressUnmanagedCodeSecurity] [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate int AssemblyAddFunction(int x, int y); [DllImport(“kernel32.dll”)] private static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); ……………………………… byte[] assembledCode = { 0x55, // 0 push ebp 0x8B, 0x45, 0x08, // 1 mov eax, [ebp+8] 0x8B, 0x55, … Read more

Can I overlay a WPF window on top of another?

I’ve worked around this problem by using a Popup rather than a transparent Window Update I ended up with a subclassed Popup which I call AirspacePopup. What AirspacePopup does Follow its PlacementTarget. Is not always-on-top, but placed relative to the Window in which it is being placed. This solution comes from Chris Cavanagh’s Blog. Is … Read more