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
T

Tony Richards

@Tony Richards
About
Posts
225
Topics
23
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • BJOTD
    T Tony Richards

    Obligatory XKCD: http://xkcd.com/1053/[^] Not implying that this was worth learning, of cause...

    The Soapbox com tutorial question career

  • QA error message
    T Tony Richards

    Think I got the same error: http://i46.tinypic.com/2q0p0r6.png[^] Looking at the URL (http://www.codeproject.com/script/Common/Error.aspx?errres=art_EditLocked[^]), it appears that the it was an error with a post being locked. I was trying to edit this QA post[^]. When I opened the post it wasn't locked, but when I clicked Improve Question, I'm assuming someone had already started editing, and I got the message in my screenshot.

    Site Bugs / Suggestions com beta-testing help question code-review

  • Inflating color value
    T Tony Richards

    What exactly is going wrong? Are you getting an exception or a compiler error or is it just not doing what you expect? One possible issue I can see is an overflow of the colour component. For example, with a byte, if you add 10 to 255 you'll actually end up with 9, and Math.Min won't work as you expect. You can catch this problem by surrounding the code with a checked statement, which will cause the runtime to throw on an overflow. The quickest solution to this would be to cast the byte to an int first, do the addition, and cast the result back to a byte (once you're certain it'll fit).

    WPF database help

  • Recognizing Chart Trends
    T Tony Richards

    If you know what form of equation the data should follow, least squares (Google has some good references) will fit an equation set of data. Can need some matrix juggling, but that's what computers are for...

    Algorithms algorithms data-structures tutorial question

  • Windows Phone 7 Development
    T Tony Richards

    I think this answers a couple of your questions: 3. Windows Phone 7 uses a cut-down version of Silverlight (with a extra few phone-specific controls). 6. You can use the same standard TCP/IP classes as on Windows (with a few restrictions). 7. Software deployment to a phone works through the Marketplace. This provides notifications about possible updates, but doesn't seem to allow auto-update. 8. The dev software comes with a simulator, but it doesn't beat testing the software on a real device. You should be able to get more info from the Microsoft website.

    Mobile csharp database asp-net visual-studio wpf

  • What does the using System; line do ?
    T Tony Richards

    The using keyword just makes your code a little simpler by allowing you to not specify namespaces when accessing classes. For example, if you have this class:

    namespace Tester
    {
    class Test
    {
    private void TestMethod()
    {
    // Do Something
    }
    }
    }

    Without a using statement, you would use it like this:

    var x = new Tester.Test();

    With a using statement, you can have:

    // At the top of your file, with the rest of the using statements
    using Tester;

    // In the function
    var x = new Test();

    Provided you don't have a class name collision (which namespaces are used to avoid in the first place), you end up with 'simpler' code (for a given value of simpler). However, they aren't essential. The DLL references are managed by the project file and then passed directly to the compiler, not using these statements. Incidently, this isn't a specifically C# thing, the using namespace construct in C++ works in the same way. Does that answer your question?

    .NET (Core and Framework) csharp question collaboration performance discussion

  • Where will you remember the fallen?
    T Tony Richards

    We have a ceremony on Campus on the 11th that I plan to go to. I also have the honour of leading my St John Ambulance Cadet Unit in the local remembrance parade on Remembrance Sunday. It's sad, but I suspect there won't be that many people from the local Adult unit going to the parade. My Cadets are usually pretty keen (even when the weather is a bit grim), but the Adults just don't seem to care as much.

    The Lounge com question announcement learning

  • WTSSendMessage fails as RPC Server is unavailable
    T Tony Richards

    Immediate suggestions that come to mind:

    • Try disabling any and all firewalls on both PCs.
    • Check the RPC services are all enabled and started and functioning properly (You'll have to look these up.)
    • Try some of the Microsoft samples first and see if they run without problem.
    Managed C++/CLI sysadmin json

  • How can i create one button for two events in C# 2008 vs?
    T Tony Richards

    As an aside (ish): Please please please don't use the button text to work out what state you're in, use something like a boolean member variable instead (or, if you absolutly must use a property on the button, something like the Tag property). The code snippet you've given will break as soon as you try to localise your application, and just really isn't good practice. Something like:

    private bool started = false;

    private void button1_click(object sender, EventArgs e) {
    if (!started) {
    button1.Text = "Stop";
    // Start the job
    // ...

        started = true;
    }
    else {
        button1.Text = "Start";
        // Stop the job
        // ...
    
        started = false;
    }
    

    }

    Also, if you're working in a different thread, don't forget cross-thread access issues.

    C# question csharp visual-studio tutorial

  • Why Internet Explorer 9 Sucks Today
    T Tony Richards

    Have you tried their calibration tool?

    The Lounge html com tools

  • Doubleplusungood
    T Tony Richards

    The scale doesn't go any higher than 7: http://en.wikipedia.org/wiki/International_Nuclear_Event_Scale[^] Thankfully, Chernobyl is the only example of such an incident.

    The Lounge asp-net com announcement

  • accessing folder from project
    T Tony Richards

    I think I understand the problem. If you don't specify an absolute file path, the .Net will try and find the image relative to your current program, hence moving the bitmaps solved the problem. If you don't want the images in the same folder as your program, the simplest solution is to specify their absolute path (e.g. c:\Folder\myImage.bmp) If you do want the images to be kept in your program folder, and they are part of your VS project, make sure their Copy To Output Directory property (right click the file, select properties) is set to Copy Always or Copy If Newer.

    C# graphics help

  • Intellisense
    T Tony Richards

    First, this doesn't really have anything to do with the Windows API. I'd suggest the specific forum for your language of choice. Second, the things you are going to have to research will be Auto Complete (sp?) (Intellisense is a MS product name, I believe). And third, I hope your IDE has a plugin framework, otherwise this is going to be a pain....

    Windows API visual-studio help question hardware tutorial

  • How can I block an http request?
    T Tony Richards

    I'm chosing to assume you aren't doing this for malicious purposes. Please don't. A decent firewall will allow you to stop a program from accessing the internet.

    C# question sysadmin

  • how to use temporary values
    T Tony Richards

    Okay, how are you storing the data in the table (which I'll call Results). I'm imagining something like this after the first result:

    RowId Team1Id Team2Id Team1Score Team2Score
    0 1 2 1 0

    It sounds like you are doing an INSERT when you submit the data, which will give you:

    RowId Team1Id Team2Id Team1Score Team2Score
    0 1 2 1 0
    1 1 2 3 0

    When you want to update the score, use an UPDATE command instead of a INSERT command. You'll need the row's Primary Key (RowId in my example), and you'll end up with this:

    RowId Team1Id Team2Id Team1Score Team2Score
    0 1 2 3 0

    As you want.

    Linux, Apache, MySQL, PHP tutorial database mysql regex announcement

  • Article Forum Post Expansion Bug
    T Tony Richards

    I'm also using Chrome 8 and can't replicate it either.

    Site Bugs / Suggestions csharp wpf com help

  • p/invoke _stat
    T Tony Richards

    Have you checked the calling convention? The last time I got an error like this, this was the reason. Oh, and please use <pre></pre> to make your code clearer

    C# csharp tutorial question

  • In related CP praise
    T Tony Richards

    At the bottom of that header block, on the right hand side (IIRC).

    The Lounge c++ com question

  • Don't tell Christians' DNA... [modified]
    T Tony Richards

    This blogger would tend to agree: http://scienceblogs.com/insolence/2011/01/the_nobel_disease_meets_dna_teleportatio.php[^] Apparently, the reaction they used to replicate DNA is extremely vulnerable to contamination.

    The Lounge com question

  • Dynamic assembly information
    T Tony Richards

    Not neccesarily: 'Some countries will not accept the symbol alone, they also require the word Copyright to appear in order to consider the notice valid. Using the word ensures that there can be no confusion.' http://www.copyrightservice.co.uk/copyright/p03_copyright_notices[^]

    C# csharp 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