Search Results - VBForums

Search:

Type: Posts; User: Evil_Giraffe

Page 1 of 13 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    26
    Views
    364

    VS 2010 Re: Help me understand Generics

    Maybe you meant that you've never needed to define your own generic class, but I can assure there are plenty of use cases for doing so.
  2. Replies
    26
    Views
    364

    VS 2010 Re: Help me understand Generics

    Perhaps you actually want your class to be non-generic, like this:

    Class MyGenericList
    Inherits List(Of MyGeneric)

    In this instance, because you haven't said "(Of MyGeneric)" as...
  3. Replies
    26
    Views
    364

    VS 2010 Re: Help me understand Generics

    Inside the class MyGenericList(Of MyGeneric), the "MyGeneric" is a type variable, and you haven't defined what the type is. It is only when you instantiate one and make it a "closed generic" (i.e.,...
  4. Replies
    9
    Views
    223

    Re: Multithreading many times.

    If you're writing an RSS Checker then your threads are going to spend most of their time blocking waiting for network responses. In this case I prefer using an asynchronous call which doesn't require...
  5. Re: Is creating subroutines instead of nested ifs a waste or inefficient.

    Whilst I agree that it's worth taking a performance hit for more maintainable code, I've got to question whether there would be any performance hit in this case. If you build with a Release profile,...
  6. Re: 2 elementary questions about vb.net function calls

    A Release configuration will have Optimisations on by default. You are using a Release configuration for performance testing, right?

    A Debug configuration will variables around for longer so that...
  7. Replies
    12
    Views
    385

    Re: Decimal point

    The error is that you're calculating the amount of VAT incorrectly. The value of VAT is not 123.6798, it is actually 123.67 in this case. You need to round/truncate (depending on the business rules)...
  8. Replies
    14
    Views
    332

    Re: Communication DB Location

    Why not just give the database machine a network name that is part of the config supplied with the app? This solution is completely overkill IMO.
  9. Replies
    7
    Views
    232

    Re: Using Percentages

    The CalculateCommission function shouldn't take the commission percentage. It is responsible for calculating the commission on a given value of sales, therefore it is responsible for working out the...
  10. Replies
    19
    Views
    395

    VS 2013 Re: Where did my stuff go?

    Another thing you might want to consider is using a source control system. When you get to a "known good" point, commit the current code to source control and then you can always go back to a...
  11. VS 2013 Re: HowTo Make Natural CopyToClipboard For Use Outsite The Program [Simple!]

    You don't mean copy information from your program to the clipboard so that other programs can get it?

    You actually mean have a program that will copy out of another program?

    How would you...
  12. VS 2013 Re: HowTo Make Natural CopyToClipboard For Use Outsite The Program [Simple!]

    Did you try a web search for this? https://duckduckgo.com/?q=vb.net+clipboard
  13. VS 2010 Re: Nested Class - Prevent Instantiation of Nested Class

    Enforcing this will be complicated, are you sure it's worth it? What is the issue if an application instantiates an instance of the class?

    You'd also want the constructor to be just Friend if you...
  14. Re: Real time updating of label in for each loop

    My stance was that if it takes long enough to warrant giving the user visual feedback, it warrants not blocking the UI thread.



    ...other than the pedantic and allowing Windows to do its thing...
  15. Re: Real time updating of label in for each loop

    A function running on the UI thread shouldn't be running for long enough to warrant updating the UI in the middle of it. If you have a loop running for that long you should either:
    1) run that loop...
  16. Re: [RESOLVED] Commutative Property of Objects

    If it ain't commutative, it ain't equality. End of.
    Maybe we can relax the constraints a little and take your non-transitive example and call it equality, but it ain't really so either. I just can't...
  17. Re: Commutative Property of Objects

    Nope, not certain, hence "potential to" and "may break stuff".

    However, it's not things like IEqualityComparer and the like that you need to be thinking of. It's more that the equality operator...
  18. Re: Commutative Property of Objects

    I would not override the = operator in any way that lost commutativity. The = operator has the potential to be called by the framework in unexpected places, and may break stuff if it doesn't follow...
  19. Replies
    6
    Views
    253

    VS 2012 Re: problem with timer

    My guess from reading your code is that you want the following to happen:

    1) When the form loads, show "15:00" on a label, and wait until that time arrives.
    2) When it is 15:00, run the "Do Some...
  20. Replies
    2
    Views
    112

    VS 2013 Re: Declaring Variables in Loops

    Also, this could be settled by consulting the VB language reference for Scope:

    http://msdn.microsoft.com/en-us/library/1t0wsc67.aspx:
  21. Replies
    2
    Views
    112

    VS 2013 Re: Declaring Variables in Loops

    Except by doing Dim arrayCheck(2) As Integer you've declared a variable and initialised the array. Try adding this to show that an array variable will retain its value if you don't reinitialise the...
  22. Replies
    2
    Views
    128

    Re: copying binary data from text file

    IF the file contains text and binary data, I'd guess that it's a binary file where some of the data should be interpreted as character data. At which point you should read it out as binary, find the...
  23. Re: How to best pass a value to a parameter?

    The difference between SubA and SubB in this scenario is only in terms of looking at the code. At execution time that variable in SubB will be inlined and the two will execute identically.

    Don't...
  24. Replies
    15
    Views
    482

    Re: Hungarian Notation?

    Actually, not quite. Hungarian Notation as known and understood by the majority of developers was developed by technical authors based on a fundamental misunderstanding of a much more useful and less...
  25. Replies
    25
    Views
    575

    VS 2010 Re: iteration through background workers

    I'd actually not recommend Tasks to you right now. Tasks are a great implementation of various async patterns (although I personally have some trepidation linking directly to their API) but unless...
  26. Replies
    38
    Views
    791

    Re: Zero-length or Nothing

    I'm not just talking about TryParse. I'm talking about the more general TryXXX Pattern. I work with rather large information processing systems that don't take a huge relative amount of user input...
  27. Replies
    25
    Views
    575

    VS 2010 Re: iteration through background workers

    If you were introducing background workers because you had multiple CPU-bound operations, I would advise you to read the file and put the definition of each proxy to check into a ConcurrentQueue, and...
  28. Replies
    38
    Views
    791

    Re: Zero-length or Nothing

    FTFY. There is nothing unclear or inelegant about the approach, you're just not used to it. You'd better get used to it though, because as the languages and frameworks increasingly adopt asynchronous...
  29. Replies
    38
    Views
    791

    Re: Zero-length or Nothing

    It's a typically functional style of writing code, which C# is increasingly leaning towards. If you've written any Javascript in the last 5 years you'll be very used to this pattern as well. Not so...
  30. Replies
    38
    Views
    791

    Re: Zero-length or Nothing

    That's because there is an answer to the question "What is this Control's text value?", it's just that the answer might be a zero-length string.


    If you've considered the problem and decided that...
  31. Replies
    38
    Views
    791

    Re: Zero-length or Nothing

    Returning Nothing indicates that there is no answer. Returning a zero-length string indicates there is an answer, and the answer is a zero-length string.

    I fail to see why people get confused over...
  32. Replies
    2
    Views
    143

    VS 2013 Re: VB.net Unit Testing Forms

    The trick to unit testing UIs is to not have your logic in the code behind of the UI, but in separate classes that know nothing about the UI. Most UI architecture patterns revolve around separating...
  33. Replies
    2
    Views
    160

    VS 2010 Re: GCSE Programming Hekp please?

    May I quickly ask what exam board and course you are studying for? There's a lot that's questionable about the above code that may be perfectly acceptable for your course, so there's no point going...
  34. Replies
    10
    Views
    276

    Re: multithread not working?!?

    Also, you probably shouldn't be using the Thread class directly, but rather a higher-level abstraction like a BackgroundWorker.
  35. Replies
    10
    Views
    276

    Re: multithread not working?!?

    Yes, thread1.Start will start the thread. Your original post suggested you thought that it should execute the thread's method when creating the thread before you stepped onto the thread1.Start line...
  36. Replies
    10
    Views
    276

    Re: multithread not working?!?

    Well, no, it wouldn't. You haven't started the thread yet, so that function won't be executing. You've simply passed it the address of that method so that the thread knows what code to execute when...
  37. Replies
    8
    Views
    336

    VS 2010 Re: byte array cleaning

    Whilst I'm usually the first to question a LINQ one-liner, surely all we need to do in this instance is the following:

    bytes.Where(Function(val As Byte, index As Integer) index Mod 115 >...
  38. Re: The easiest way to not use parallel array ?

    I'd have the dual image logic in a separate class, looking maybe something like this:

    Imports System.ComponentModel

    Public Class EmployeeViewModel
    Implements INotifyPropertyChanged

    ...
  39. Replies
    13
    Views
    659

    Re: Decompiler suppression

    Obfuscation wouldn't even help with this, if you embed the connection details in the code it will show up as a string inside the assembly without any decompiling at all.


    Indeed, frankly you...
  40. Re: Collection was modified...or not

    No, in this instance you're not enumerating the Dictionary, you're enumerating a separate array. Try it without the ToArray and you're back to enumerating something out of the Dictionary. If you...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.