Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Dr Herbie

@Dr Herbie
About
Posts
46
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Bitmap to byte array?
    D Dr Herbie

    Hi, I have a System.Drawing.Bitmap of a screen capture that I want to convert to a byte array. Any ideas on how to do this? I expected the bitmap object to have some sort of ToArray method, but it hasn't. I'm rather stumped. TIA Dr Herbie Remember, half the people out there have below average IQs.

    C# graphics data-structures tutorial question

  • System.Diagnostics on NT4.0?
    D Dr Herbie

    Hi folks, I have an issue with the System.Diagnostics.PerformanceCounter class (and associated classes). I have a Windows Service written in C# that creates and uses it's own performance counters and this all works fine on XP, but when I run the service on NT4 (the target platform, unfortunately) I get a PlatformNotSupportedException thrown. Now, the documentation says the PerformaceCounter, and CounterCreationDataCollection are supported on NT4.0 workstation and server -- are the docs wrong, or is there a part of the jigsaw missing? Cheers Dr Herbie Dr Herbie Remember, half the people out there have below average IQs.

    C# csharp sysadmin performance help question

  • Performace of exceptions?
    D Dr Herbie

    Hi folks, I recently reviewed some code from a collegue and I found he was using exceptions a great deal -- my gut feeling was that he was using them too much (his dictionary implementations throw exceptions if you pass a key for a non-existent entry, that sort of thing). I set the IDE to break whenever an exception is thrown and I got bored after the 20th exception before the UI even displayed. So my question is: What is the performance hit of exceptions, as opposed to returning a null or empty value? Any pointers to articles would be especially useful as I will probably need hard data to win the argument. Thanks Herbie Dr Herbie Remember, half the people out there have below average IQs.

    C# question visual-studio design performance

  • IDesignerHost resources?
    D Dr Herbie

    Solution - in case anyone was interested ... Classes derived from ToolboxItem must be serializable and the IToolboxService DeserializeToolboxItem method must deserialise the correct (derived) type. So now I can manipulate my controls as they are created. Dr Herbie Remember, half the people out there have below average IQs.

    .NET (Core and Framework) question learning workspace

  • IDesignerHost resources?
    D Dr Herbie

    Hi, Does anybody know of any good resources for learning the intricacies if IDesignerHost? I about halfway to where I want to be, but I can't implement my main feature: pre-specified individual controls. E.g. Our configurable dialog has two possible button controls, OK and Cancel. I want to show the user a list of possible controls that will contain an entry for each of these buttons. The ToolboxItem class only handles control types, so I can only specify 'add a button', and not 'add the OK button'. I have tried deriving my own ToolboxItem based classes, but then the built-in drag drop between the toolbox service and the designer host stops working. It's starting to drive me nuts. Configuration is a major feature of our product, so I have to find a way to do this. Any resources or guidance would be very much appreciated. Dr Herbie Remember, half the people out there have below average IQs.

    .NET (Core and Framework) question learning workspace

  • Design Process....
    D Dr Herbie

    Depends on who has the 'vision'. If it's mine then I usually start with UML in Visio (or on paper). If it's the customer's vision, then I have had good results by sitting down with the customer, a pad of unlined paper and a pancil (and an eraser). I get the customer to draw all the screens they can think of, and then explain them to me ('this button will conver the doohicky into a whatchamacallit'). We can quite quickly get all the main use cases down. It is often the case that the customer has an idea, but hasn't really thought through the process. Working things through with them shows them that there may be more to consider and it makes them think more deeply about how they want things to work and all the pitfalls that might arise. I have only done this for small projects so far, but it seems that most customers relate to it pretty well -- non-programmers only see the GUI so that is how they think. Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge design question

  • Another surprise in packaged food...
    D Dr Herbie

    Uwe Keim wrote: UUUUUUUUUUrban legend. Not this time. This was reported by the BBC yesterday. It was a two foot long Corn snake (harmless) which are a popular choice for people who want snakes as pets here in the UK. Pet snakes are very good at escaping. An investigation is being held my the manufacturer to determine at what point the snake entered the box (presumably so that they can demonstrate it was nothing to do with them). Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge com

  • tiered development discussion question
    D Dr Herbie

    Hi, On my current project (first C# project now into year 2), I designed a Data Access Layer that would take a data object (all derived from the same utility base class) and do the ORM. The DAL objects are all remotable and stateless so they can live near the DB and use COM+ to scale well. The Business Logic Layer had two sub-layers. The custom data objects for the DAL are the first layer and are there purely for data access. Each data object represents a row in a single table (they use data transfer object pattern for remoting to the DAL). The upper layer in the BLL are the domain entities that aggregate multiple data entities and handle the relationships between them (one to many, many to one, etc). The domain entities also have type-safe collections that use the observer pattern to enforce relational integrity between the data objects. Our workflow layer can then use the domain entities from the BLL to perform the tasks the users want. I have found that this system works well and allows us to use CodeSmith to auto-generate most of the BLL objects directly from the database. It also pushes all the ADO stuff back into the DAL which is useful when you have to support (potentially) any type of database. This is also why we use our domain objects to enforce referential integrity. The downside of this system is that because ADO is remote, transactions are tricky to implement. Currently re don't have read transactions and we fake write transactions by creating a collection of data entities to be written out together (they share a base class) and writing this collection to the DAL which uses a transaction internally. Frankly, our software doesn't do anything clever with the database (it was designed in 1995 by (IHMO) a bunch of amateurs). I never had any formal education on n-tier design either, but I'm a compulsive textbook reader and my design seems to square-up well to those I have read since. PS: I am currently doing research for an article (or pssibly a series) comparing some of the ORM/persistence libraries out there. Most so far simply seem to generate wrappers for ADO datasets, but I've just started on NHibernate which seems to be more substantial. Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question com design testing business

  • Static method thread safety?
    D Dr Herbie

    Hi folks, Do I need to use the [MethodImpl(MethodImplOptions.Synchronized)] attribute on statis methods, or are they implicitly thread-safe? Thanks in advance. Dr Herbie Remember, half the people out there have below average IQs.

    C# question

  • STA Activex Controls and AppDomains?
    D Dr Herbie

    Hi folks, I currently have to interop to an old ActiveX control that requires the STA threading model. In order to get the control to work, I have to use STAThreadAttribute on the Main method of my desktop application, and set my ASP.NET application to be ASP compatible. This has impact on the threading of the rest of the application which is undesirable (especially on the ASP.NET application). Is there any way to load the ActiveX into a separate STA threaded AppDomain, and keep the main AppDomain MTA? I haven't been able to find any examples or explanations for this. We need to have considerable interaction with the ActiveX control throughout the rest of our code, and I don't know the impact of cross-AppDomain calls on performance, but I can't test until I find out how to separate the AppDomains. Any interop/threading guru's out there? PS. We can't rewrite the Activex control as it is third party (and has been discontinued). It contains complex mathematical parsing that we need to maintain for backward compatability. Dr Herbie Remember, half the people out there have below average IQs.

    C# com json csharp asp-net performance

  • Class field initialisation question.
    D Dr Herbie

    Thanks for the replies, it has put my mind at rest :) Dr Herbie Remember, half the people out there have below average IQs.

    C# question

  • Class field initialisation question.
    D Dr Herbie

    Hi folks, OK, what I'm interested in are the technical pros and cons of data initialisation in a classes. I.e. which is better? class Test { private int mInt = -1; Test() { // Do nothing } } or class Test { private int mInt; Test() { mInt = -1; } } The reason I ask is that I usually have several constructors on my classes and I prefer the first method so I can guarantee that whichever constructor I'm entering, all the fields are initialised the same way. But are there technical reasons not to do this? Dr Herbie Remember, half the people out there have below average IQs.

    C# question

  • Guitar Port...
    D Dr Herbie

    Hi Joe, I bought a GuitarPort a couple of years ago and it's a great piece of kit. You won't get any benefit from the site without the GuitarPort hardware, but if you get one the site is fantastic for learning tunes and techniques. I don't subscribe anymore because I rarely play these days (now a proud father for the first time) but for 6 months I was downloading tutorials from the site constantly. The combination of hardware, software and web site make the tutorials fantastic. You hear the music being played while the Tablature shows on screen and you can play along. There's even a nifty feature to slow everything down if you can't keep up! The list of known songs and artists is large and there are techniche tutorials too. Highly recommended if you play a lot! :) Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge com tutorial question

  • Using Modal ASp.NET pages
    D Dr Herbie

    Hi, I haven't used ASP.NET much before so excuse the total ignorance I am about to display. :doh: I have an application that has both a desktop and an ASP interface. What I want to be able to do is (in windows speak): Show modal dialog A. User clicks button Execute code of style : Start button handler. Create Dialog B (dynamic) ShowDialog B Retrieve input from Dialog B Process data End button handler. In other words, I want to show Dialog B, blocking the process flow until it completes, then immediately grab the data from it and continue. So far I have only been able to show ASP.NET pages using non-modal methds, so that as soon as the show is executed my code continues to retriee the data before the dialog has completed showing. The only colution is to add an event handler to the dialog close event and continue the data processing on the event handler. This makes the code unnecessarily messy and hard to follow. Is there something really obvious that I've missed? :wtf: Dr Herbie Remember, half the people out there have below average IQs.

    ASP.NET csharp asp-net question

  • How do they put lead in pencils?
    D Dr Herbie

    But why can't you see the seam? Surely when you sharpen a pencil you should be able to see that join between the two bits of wood! I have decided that pencils are made my magic and that any supposed photos are actually faked (possibly as April Fools Day jokes). :) Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question

  • How do they put lead in pencils?
    D Dr Herbie

    This has always bothered me. How it is done? The wood and the graphite seem so tightly matched -- how do they get it in there? Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question

  • I'm getting ill...
    D Dr Herbie

    Actually I'm not a medical Dr. It took four years to get my PhD, and all I got out of it was the right to put Dr infront of my name, so I'm damn well going to use it! Look in the leaflet inside any pack of pain killers and you'll find that side effects include headaches. Go figure. Besides, I wouldn't ask a medic about too much chemical consumption, as students they were always the worst for intake of caffien, nicotine, alchohol and any spare pills lying around. :-D Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question

  • I'm getting ill...
    D Dr Herbie

    JohnJ wrote: I'd recommend Bacon, Sausage, Black Pudding, Fried Egg with optional fried bread Ah, the good old 'kill or cure' Full English! It tastes even better if someone else cooks it for you! Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question

  • Petals Around the Rose
    D Dr Herbie

    Hmm. A puzzle I actually solved almost immediately. That doesn't happen often. Do we know what it says about the psychology of the player? Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge html

  • 3 year old dies of obesity
    D Dr Herbie

    norm.net wrote: ban Maccie D's from every control in the world That's what the report that highlighted the death of this child was about: Three year old dies of obesity-related causes, is this the governments fault? My answer is no, don't ban McD; everyone is capable of walking past and deciding whether they're eating well. Ignorance is no excuse. Your possibly right about banning MacD trips with your children, though. Of course they'll go my themselves when they're teenagers, but by then you'd hope they have some common sense (if that's possible for teenagers to have :)). My own son is too young for burgers (not on solid foods yet). We won't ban McD, but we won't be going there regularly either. I think that's the best way to teach a child that 'a little of what you fancy does you good' as my grandmother used to say. Dr Herbie Remember, half the people out there have below average IQs.

    The Lounge question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups