dbasnett's Profile User Rating: -----

Reputation: 111 Stalwart
Group:
Contributors
Active Posts:
610 (0.26 per day)
Joined:
01-October 08
Profile Views:
8,193
Last Active:
User is offline Today, 10:54 AM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
50

Latest Visitors

Icon   dbasnett has not set their status

Posts I've Made

  1. In Topic: How to extract sub element value from XML node

    Posted 17 Jan 2015

    This will get all the nodes. Not sure what you wanted.

    To test
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            RichTextBox1.Clear()
            getNodes(xe)
        End Sub
    
    


    getNodes
        Private Sub getNodes(el As XElement)
            Static lvl As Integer = 0
            Dim lvlstr As String = New String(ControlChars.Tab, lvl)
            lvl += 1
            For Each xe As XElement In el.Elements
                RichTextBox1.AppendText(lvlstr)
                If xe.Elements.Count > 0 Then
                    RichTextBox1.AppendText(String.Format("> {0}", xe.Name))
                    RichTextBox1.AppendText(Environment.NewLine)
                    getNodes(xe)
                Else
                    RichTextBox1.AppendText(String.Format("- {0}  {1}", xe.Name, xe.Value))
                    RichTextBox1.AppendText(Environment.NewLine)
                End If
            Next
            lvl -= 1
        End Sub
    
    


    Data (there was at least one error in the original)

        Dim xe As XElement = <Tools>
                                 <Tool ID="100003" Units="Millimeter">
                                     <Description>100003</Description>
                                     <Teeth>1</Teeth>
                                     <Type>Turning</Type>
                                     <Cutter>
                                         <Reference ID="12143 - N123G2-0300-0002-GF">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Torneamento - Insertos paramétricos</ToolID>
                                             <EntityName>12143 - N123G2-0300-0002-GF</EntityName>
                                             <Origin>
                                                 <X>34.8</X>
                                                 <Y>0</Y>
                                                 <Z>-82.9</Z>
                                             </Origin>
                                             <Rotation>
                                                 <X>0</X>
                                                 <Y>-90</Y>
                                                 <Z>0</Z>
                                             </Rotation>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                     </Cutter>
                                     <Holder>
                                         <Reference ID="12135 - C5-570-32-LF">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Holders &amp; Acessorios</ToolID>
                                             <EntityName>12135 - C5-570-32-LF</EntityName>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                         <Reference ID="12142 - 570-32L123G18B067A">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Holders &amp; Acessorios</ToolID>
                                             <EntityName>12142 - 570-32L123G18B067A</EntityName>
                                             <Origin>
                                                 <X>21</X>
                                                 <Y>0</Y>
                                                 <Z>-42</Z>
                                             </Origin>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                     </Holder>
                                     <DrivenPoint ID="1">
                                         <Type>-1</Type>
                                         <Radius>0</Radius>
                                         <X>35</X>
                                         <Y>0</Y>
                                         <Z>-83.1</Z>
                                     </DrivenPoint>
                                     <DrivenPoint ID="2">
                                         <Type>-1</Type>
                                         <Radius>0</Radius>
                                         <X>32</X>
                                         <Y>0</Y>
                                         <Z>-83.1</Z>
                                     </DrivenPoint>
                                     <CutterCompensation ID="1">0.2</CutterCompensation>
                                     <CutterCompensation ID="2">0.2</CutterCompensation>
                                 </Tool>
                                 <Tool ID="100004" Units="Millimeter">
                                     <Description>100004</Description>
                                     <Teeth>1</Teeth>
                                     <Type>Turning</Type>
                                     <Cutter>
                                         <Reference ID="12140 - N123G2-0318-0008">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Torneamento - Insertos paramétricos</ToolID>
                                             <EntityName>12140 - N123G2-0318-0008</EntityName>
                                             <Origin>
                                                 <X>34.2</X>
                                                 <Y>0</Y>
                                                 <Z>-82.3</Z>
                                             </Origin>
                                             <Rotation>
                                                 <X>0</X>
                                                 <Y>-90</Y>
                                                 <Z>0</Z>
                                             </Rotation>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                     </Cutter>
                                     <Holder>
                                         <Reference ID="12135 - C5-570-32-LF">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Holders &amp; Acessorios</ToolID>
                                             <EntityName>12135 - C5-570-32-LF</EntityName>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                         <Reference ID="12139 - 570-32L123G18B130A">
                                             <FileName>MASTER_LIBRARY.tls</FileName>
                                             <ToolID>Holders &amp; Acessorios</ToolID>
                                             <EntityName>12139 - 570-32L123G18B130A</EntityName>
                                             <Origin>
                                                 <X>21</X>
                                                 <Y>0</Y>
                                                 <Z>-42</Z>
                                             </Origin>
                                             <NoSpin>0</NoSpin>
                                             <Alternate>Off</Alternate>
                                         </Reference>
                                     </Holder>
                                     <DrivenPoint ID="1">
                                         <Type>-1</Type>
                                         <Radius>0</Radius>
                                         <X>35</X>
                                         <Y>0</Y>
                                         <Z>-83.1</Z>
                                     </DrivenPoint>
                                     <DrivenPoint ID="2">
                                         <Type>-1</Type>
                                         <Radius>0</Radius>
                                         <X>31.82</X>
                                         <Y>0</Y>
                                         <Z>-83.1</Z>
                                     </DrivenPoint>
                                     <CutterCompensation ID="1">0.8</CutterCompensation>
                                     <CutterCompensation ID="2">0.8</CutterCompensation>
                                 </Tool>
                             </Tools>
    
    
  2. In Topic: making a timer give a more accurate result

    Posted 18 Dec 2014

    View Postfrazereastm, on 18 December 2014 - 06:26 AM, said:

    here I attached my project as it is so far, I am yet to add the uncertainty of measurement labels (which will be placed above and below estimated end date, and will display the maximum finish date and the minimum finish date taking into account errors that could occur when taking the initial measurements) and I am sure there is some bugs I can fix, or things I can tweak.
    the sole user of this program will not be myself so I want to make it easier for someone with zero experience of the program to be able to use it.

    ANY suggestions are welcome and I will try implement all ideas I think will improve the program as this the first 'proper' program I am putting all my efforts into making it a good one,
    thanks in advance


    All of the math appears unnecessary. Stopwatches have properties that contain the values needed. Here is a short example.

        Dim stpw As New Stopwatch
        Dim whenStart As DateTime
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'start
            whenStart = DateTime.Now
            stpw.Restart()
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            'stop
            stpw.Stop()
            Dim whenStop As DateTime = whenStart.Add(stpw.Elapsed)
    
            TextBox1.Text = stpw.Elapsed.TotalSeconds.ToString
            TextBox2.Text = whenStop.ToString
        End Sub
    
    
  3. In Topic: Challenge: Longest Bit Sequence

    Posted 6 Nov 2014

    Don't know spoiler tags...
    Spoiler
  4. In Topic: converting integer to a string

    Posted 5 Nov 2014

    You might find that using an Enum is what you want. It assumes that your names are statically defined.

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
            Handles Button1.Click
            TextBox1.Text = GetName(CInt(NumericUpDown1.Value))
        End Sub
    
        Public Function GetName(ByVal ID As Integer) As String
            Dim Name As Names = CType(ID, Names)
            Return Name.ToString
        End Function
    
        Enum Names
            Noah = 1
            Sophia = 2
            Liam = 3
            Jacob = 4
            William = 5
        End Enum
    
    
  5. In Topic: Challenge: Outshots?

    Posted 26 Oct 2014

    An attempt is here (VS2012):
    Outshots Solution

    The binaries have been removed.

My Information

Member Title:
D.I.C Addict
Age:
Age Unknown
Birthday:
July 29
Gender:
Years Programming:
45

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Friends

Comments

dbasnett has no profile comments yet. Why not say hello?