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
W

Wes Jones

@Wes Jones
About
Posts
111
Topics
35
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Control similar to contacts viewer on iPhone for WPF?
    W Wes Jones

    Hey all, I'm new to WPF/Silverlight, which I've noticed is of the sweet goodness. In a project, I'd like to add a listbox/grid type control that's similar to the Contacts app on the iPhone, as seen in this screenshot[]. ie: it has an A-Z type thing on the side , which when clicked, takes you to the group of items starting w/ that letter. The goal is to display a potentially "large" # of items in it but still make it easy to find the one you're looking for. Maybe at the top, it'd have a textbox for autocompletion while typing, and/or a search button, similar to what you get in Blend for searching properties in the Property editor window. Does anyone know what I mean? I'd be interested in any free or paid 3rd party control which has this or parts of this,so if you know of any, let me know. If I should roll my own, could you describe the basic layout items? Would it just be a datagrid/dataview type control using a grouping feature, & scrollviewer & a few snippets to move it to items based on clicks, etc? Any help is appreciated!

    WPF csharp css ios wpf com

  • FML, Edition 6580
    W Wes Jones

    I guess somebody forgot to ask question "how many thousands of lines of code in one function is too many?"

    The Weird and The Wonderful

  • FML, Edition 6580
    W Wes Jones

    Complements of a ball of VB6 mud:

    6580 Exit Function
    

    where 6580 is an automatically generated line number, starting from 1.

    The Weird and The Wonderful

  • Exstream Younit Testing
    W Wes Jones

    lol! that's ridiculous!

    The Weird and The Wonderful php visual-studio com testing beta-testing

  • Now that's a first [modified]
    W Wes Jones

    not a bad idea!

    The Weird and The Wonderful

  • Now that's a first [modified]
    W Wes Jones

    lol! I think they were using that as the coding standards document!

    The Weird and The Wonderful

  • Now that's a first [modified]
    W Wes Jones

    nah, it's bad. who names their variables like this in a for loop? were it written "for i = 0 to iCount", I'd be giving this guy a high 5 already.

    The Weird and The Wonderful

  • Now that's a first [modified]
    W Wes Jones

    In all of computer programdom, I've never encounterd this arrangement of i & iCount in a for loop:

    i = getcountofsomething()
    For iCount = 0 To i
      If something(iCount)) Then
        bOk = True
        Exit For
      End If
    Next iCount
    

    modified on Thursday, February 11, 2010 6:33 PM

    The Weird and The Wonderful

  • Good thing that array's big enough
    W Wes Jones

    mlNumOfSomething = SomeClass.GetSomething(anIDArray())

    For lli = 1 To mlNumOfSomething

    SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
    ReDim Preserve msAllAgencies(1 To mlNumOfSomething)
    msSomeArray(lli) = aDescription
    

    Next lli

    The Weird and The Wonderful data-structures

  • Another fine gem mined from the codebase
    W Wes Jones

    in this case, the incoming parameter defaults to "ByRef", lRetVal defaults to Variant, and the return value is only set when the line of code "ThisFunctionName = aValue", so luckily it sets the lsDate param, but the return value is never set 'cause the author was retarded

    The Weird and The Wonderful ruby database help career

  • CBool(IIf(BooleanFunction(), True, False))
    W Wes Jones

    That's a mighty nice turd you found there

    The Weird and The Wonderful

  • Another fine gem mined from the codebase
    W Wes Jones
    Private Function SomeCrappyCode(lsDate As String) As Long
      On Error GoTo ErrorHandler
    
      Dim llRetval
      Dim llPosition As Long
      
      'Updates the US Month Name in SQL Date to Locale
      'Month Name in Locale Language
      
      llPosition = InStr(lsDate, "Jan")
      If llPosition > 0 Then
        lsDate = Left(lsDate, llPosition - 1) & Format(DateSerial(98, 1, 1), "MMM") & right(lsDate, Len(lsDate) - 3)
        llRetval = True
        Exit Function
      End If
      
      'Copy & paste the above code block 11 more times for Feb...December  
    
      mlUpdateMonthStringLocale = llRetval
        
    Exit Function
    ErrorHandler:
    
      WriteErrorLogEntry Err.number, "SomeCrappyCode", Err.description
      Exit Function
      Resume
    
    End Function
    
    The Weird and The Wonderful ruby database help career

  • Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all?
    W Wes Jones

    and they say it's hard to improve upon perfection...

    The Weird and The Wonderful question

  • Where may I find this person, their immediate family, anscestors and future descendants so I may take revenge upon them all?
    W Wes Jones

    If Something() Then
    lblpnl10(1).Caption = GetCaptionText(10977, lblpnl10(1).Caption)
    lblpnl10(0).Caption = GetCaptionText(10978, lblpnl10(0).Caption)
    frapnl10(0).Caption = GetCaptionText(10979, frapnl10(0).Caption)
    chkKeepOrigRadioName.Caption = GetCaptionText(10980, chkKeepOrigRadioName.Caption)
    lblpnl03(14).Caption = GetCaptionText(10981, lblpnl03(14).Caption)
    lblpnl03(13).Caption = GetCaptionText(10982, lblpnl03(13).Caption)
    Frame12.Caption = GetCaptionText(10983, Frame12.Caption)
    Label13.Caption = GetCaptionText(10984, Label13.Caption)
    Label5.Caption = GetCaptionText(10985, Label5.Caption)
    Label14.Caption = GetCaptionText(10986, Label14.Caption)
    Frame9.Caption = GetCaptionText(10987, Frame9.Caption)
    chkLogLateShiftEnd.Caption = GetCaptionText(10988, chkLogLateShiftEnd.Caption)
    ....48 more
    End If

    The Weird and The Wonderful question

  • Error: cannot convert from 'ref Scripting.Dictionary [c:\...\Interop.Scripting.dll]' to 'ref Scripting.Dictionary []'
    W Wes Jones

    Quick Q for the interop specialists among us: I have a COM object written in a VB6 legacy app. The public method I'm trying to call is something like this in VB6:

    Public Function MyFunc(ByRef theDictionary As Dictionary) as Long
    ' ... do stuff
    End Function

    The VB6 project has a Reference to "Microsoft Scripting Runtime". In C#, I've imported this vb6 type w/ the type library importer, and have a reference to "Microsoft Scripting Runtime", ie: Interop.Scripting.dll in my C# project. When I call this class from C#, like so:

    public int CallMyFunc()
    {
    Vb6Type vbObj = new Vb6TypeClass();

    Scripting.Dictionary vbDictionary = new Scripting.DictionaryClass();
    ...
    int retVal = vbObj.MyFunc(ref vbDictionary);
    ....
    

    }

    I end up w/ a compiler error that doesn't make sense to me: Error 3 Argument '1': cannot convert from 'ref Scripting.Dictionary [c:\...\Interop.Scripting.dll]' to 'ref Scripting.Dictionary []' Note that it can't convert the variable vbDictionary to an array of Scripting.Dictionary. Intellisense will show the parameter type as "ref Scripting.Dictionary theDictionary", hitting F12 takes me to a function of the imported type that looks like this:

    [DispId(1234)]
    int MyFunc(ref Dictionary theDictionary);

    Any suggestions? I have the source for the VB6 and I'm actaully calling a wrapper which has the same signature. I'm about to create a custom type in vb to wrap this and avoid the drama.

    C# com csharp visual-studio data-structures

  • Don't they know what an array is?
    W Wes Jones

    that's extending a quite a bit of credit, lol!

    The Weird and The Wonderful css data-structures help question career

  • This is a pleasure to read.
    W Wes Jones

    not that I know of.. it just doesn't care if the goto label there apparently.

    The Weird and The Wonderful help

  • This is a pleasure to read.
    W Wes Jones

    yes, it was. isn't it beautiful?

    The Weird and The Wonderful help

  • This is a pleasure to read.
    W Wes Jones

    Yeah, I think this was a plug in which added this mess to all new functions/subs. They've since stopped using it, but it's still as one fugly mug when you see it, especially in something like this. Were I given a free reign, I'd be all over the my delete button right now.

    The Weird and The Wonderful help

  • This is a pleasure to read.
    W Wes Jones

    Yes, only this one was even a bigger horror especially since it only has one line of code that does anything & it's not even something that could raise an error. It's positively lovely.

    The Weird and The Wonderful help
  • Login

  • Don't have an account? Register

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