Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Isshou Isshou
  • Visual Studio Performance Analysis in 10 minutes

    AndyD wrote:
    
    andur wrote:
    As pointed out, that's not a very fair measurement.

    I do know however, that I've wasted a *lot* of time by accidentally pressing "Rebuild Solution" instead of "Build Solution" in the build menu. "Rebuild Solution" really, really needs a "Yes/No are you sure" prompt


    No it doesn't. I can't think of anything worse than constantly being asked if I really want to rebuild when that's what I actually want to do. What would help though is not having the two options right next to each other. Try rearranging the menu options and see if that works better for you.


    It's always interesting to see comments like this. One feature that is a waste to someone else (for whatever reason) it a vital tool to someone else. Changes based on one person/groups perspectives is never a good thing, especially when it's something that you can work around already.


    As for the topic, along with counting potentially 998 extra milliseconds for each non-responsive event or even 1000 milliseconds for any non-success condition, the original test code counts not only the sleeping (1 second) but execution of the code for the total seconds. Since there is some marshaling done in it, it's not guaranteed to be quick, though in you're worst case event (waiting 2 milliseconds). Your count would be skewed because the stopwatch will count for at least 1002 milliseconds for ever 1 seconds you add to the "wasted time". That's ignoring the fact that Thread.Sleep(1000) is only a guarantee that it will sleep for at least 1000 milliseconds not that it will wake up in exactly 1000 milliseconds. It could be delayed even longer if a higher priority thread preempts it even after it returns to the ready state. Note that these things may actually skew the analysis to be lower than what it really is. However it still means the "analysis" is faulty.

    It should have been developed as the Tick/TimeElapsed event of one of the timers rather than a loop with Thread.Sleep. Or some other method of timing that is more accurate than relying on the Sleep method should have been used.

    Peter Richie had a blog post about Thread.Sleep and why it is useless for keeping time and other abuses of it.

    This is in addition to changes that would be needed to reconcile adding one whole second for any reason for the failed call.

  • What is the Future of Artificial ​Intelligenc​e?

    jason818_253.33 wrote:
    This would be Programs installing themselves, living from one platform to another able to migrate and evolve on their own.


    to me this would be problematic for security reasons. I mean we try to prevent programs for doing that because it is one way for viruses to migrate themselves. Then there's the question of whether AI would open up the door for virus AI, that would be a horrible though. When the virus can out-think developers trying to get rid of the virus... No networked computer would ever be safe again without some way to get rid of the virus AI or do a clean switch to a new network and disallow what lead to the virus AI before.

  • What is the Future of Artificial ​Intelligenc​e?

    jason818_253.33 wrote:
    
    Then what would be the software? and, what writes the software?do we all run the same OS?


    Well There's GodSoft's HumanOS that's closed source and comes in Moron, Standard, and Genius versions. This OS has 90% of the market.

    There's World OSH that only works with a select few brains, but is more creative than HumanOS.

    Then there's people like corona who abhor everything closed source and has somehow managed to install Linux to operate their brains... Of course that would explain a whole lot. Smiley

    Also, for anyone that gets the reference: the software would be written in LISP code.


    Humor aside, at what point would Artificial Intelligence stop being artificial? I mean at some point to make a good AI you'd have to have the AI be able to develop itself, so theoretically at some point it could be completely self-developed leaving nothing of the inferior AI behind.

    Also, would Artificial Intelligence be the same as sentience? If not what would Artificial Sentience/Sapience look like? Could Artificial Sentience/Sapience exist without Artificial Intelligence? (note that common views of AI include artificial sentience/sapience as part of the whole package: Strong AI)

  • PC upgrade ​time...​thoughts?

    mVPstar wrote:
    I'm wondering how important it is to upgrade the CPU because that would indicate a mobo change. I also don't know the benefits of DDR2. I will definitely bump up the memory to maybe 2GB.


    Thoughts?


    Wiki wrote:
    Its primary benefit is the ability to operate the external data bus twice as fast as DDR SDRAM.


    If you're system is alright for yourself. I would recommend going up to 2 GBs (just replace your current memory with 2x1g pack).

    You might be able to get a bit more out of the mobo with replacing the CPU (the biggest restriction is the 939 socket instead of the current AM-2 socket) however there isn't a whole lot of 939 CPU's that would be much better than what you have (and work with your mobo for sure).

    Replacing the video card is another decent upgrade, you might want to look into a PCI-e 2.0 card (it's backwards compatible) so that if later you want to upgrade further you can and may not need to replace the video card.

  • Debugging The Next Generation Application.

    victor louis wrote:
    Race conditions are among the most common classes of bugs found in deployed software. They are only possible in environments in which there are multiple threads or processes occurring at once that may potentially interact (or some other form of asynchronous processing, such as with UNIX signals). People who have experience with multithread programming have almost certainly had to deal with race conditions, regardless of whether they know the term.


    A race condition can happen, even on a single processor computer. It's less likely, but any time that you can not guarantee when your thread/process will be context switched out for another you can't guarantee that another one of your own threads won't run before your first thread get CPU time back. This of course means that you need to address race conditions and prevent multiple entrance into critical sections, etc from occuring. Of course this all seems "at once" to a user but is far from it in terms of performance.

    victor louis wrote:
    They are often difficult to fix, even when you are aware of their existence. Race conditions are one of the few places where a seemingly deterministic program can behave in a seriously nondeterministic way. In a world where multithreading, multiprocessing, and distributed computing are becoming more and more prevalent, race conditions will continue to become a bigger and bigger problem.

    Race conditions should be easy to fix, once you understand what the race condition is, there's many thread synchronization flags, locks, mutex, etc to deal with it. Anyone that has looked at general programming or database programming is familiar with the concepts from the reader/writer problem (also consumer/producer, and many other example situations).

    Reader/Writer situation is that a prime example: you have a reader wanting to read a record and a writer wanting to write the same record. You can't just have them both working on the same record because you're not guaranteed that the reader won't end up with part of the old record and part of the new record. In fact you couldn't accurately predict what amount of new vs old data the reader would pick up. Solutions are varied and each have benefits and drawbacks. You can lock the record while it is being read (allowing multiple readers though) or being written (allow only one writer), this prevents corruption but causes wait times, etc. You can do a transactional system where anyone working with the set of data deals with the same version of the data which prevents the wait time but is harder to implement and means the reader will get old data and thus you need to handle the case where the reader might pass this data to a writer to be written.

    Graphics is another area of race condition when performing calculations on different threads. This is where we get the idea of frame state, frame skipping, and such things to allow the processing to continue and still allow for the display to update.

  • P/Invoke with strings in Compact Framework 2.0 SP2

    You should be able to use either strings or StringBuilders.

    The important thing, above anything else is that since you're dealing with an unmanaged code that is expecting to use a reference to a unicode string that you should specify to the Marshaler how to marshal your string.

    You'll need to use the attributing:

    [MarshalAs(UnmanagedType.LPWStr)] // I'm guessing LPWStr, test this.

    Read up on UnmanagedType, and marshalling strings

    Edit, you may have to pass it as IntPtr instead, as you're needing to deal with levels of indirection.

  • Weird problem with Silverlight

    It is something you can try, but be aware of one thing is that accessing some videos behind a proxy can cause issues in 1.0. However is used to be the case that it would error out and give a error message and not just sit there.

    So, are you behind a proxy? firewall? router? restrictive policy settings?

  • IE8 Beta1 breaks WPF 3.5 (Vista & XP)

    You guys should report this, probably to the IE8 Public Beta connect channel on Microsoft Connect. You'll have to log in to a passport to see the channel to apply for it. Not sure if there is any restriction to applying for that channel. However it is the best way to report bugs associated with a beta product.

  • Virtual Machine Question

    Unfortunately Microsoft Virtual PC does not support actual hard drives being used in virtual machines. Most virtualization software prefers to use virtual hard disks as well.

    However, I do know that at least VMWare Workstation does support using an existing hard drive (and partitioning) to be used inside a virtual machine. Last I checked you do lose some properies of the drive, especially if it is sata and not IDE. This shouldn't be as big an issue with Win XP as it can be with linux setups. The bad news, Workstation isn't free. I don't know if their VMWare Player, which is free (? I think), does have this same capability or not.

  • Newie Question On Windows Programming

    retierney wrote:


    Thanks for the responses so far.  Am I correct in saying that MFC stands for 'Microsoft Foundation Classes'?  And what does WTL stand for?  I told you that I was a Windows Programmer Newbie... 


    WTL is Windows Template Library.

    There's a few concepts you'll want to come to understand.

    one of the main thing is Unmanaged and Managed. Some of this relates to what level of Windows Programming you are wanting to do.

    Unmanaged concepts:
    COM - Component Object Model
    MFC or other class libraries (ATL, WTL, etc)

    Managed concepts:
    GAC (Global assembly cache)
    BCL (Base Class Library)
    Many other concepts about the .Net Framework


    If you're looking at just making programs in Windows, going with managed languages like VB.Net (VB 7, 8, or 9), C++.Net, and C# would be a good way to get into programming on windows.

    Since you're coming from C and Java, C# will seem natural to you. You'll see the similarities to C and Java in it pretty quickly.

    If you're looking at doing Windows programming (system utilities, drivers, etc) then you'll want to look into sticking with unmanaged code, particularly C/C++ and MFC for when you need it.