New plotting software - Page 3 - diyAudio
Go Back   Home > Forums > Commercial Sector > Manufacturers > GedLee

GedLee Home of the renown Geddes Loudspeakers

Reply
 
Thread Tools Search this Thread
Old 20th May 2010, 12:16 AM   #21
diyAudio Member
 
Join Date: Mar 2005
Location: Saskatoon, Saskatchewan, Canada
Code:
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Collections.Generic


Module Module1

    Sub Main()
        Dim data As New Generic.List(Of String())
        Dim current_line As String()
        Dim width_(45) As Integer
        For i As Integer = 0 To 45
            width_.SetValue(12, i)
        Next i
        Dim wr As HttpWebRequest = CType(WebRequest.Create("http://gedlee.com/summa.txt"), HttpWebRequest)
        Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
        Dim str As Stream = ws.GetResponseStream()
        Using myStreamReader As New FileIO.TextFieldParser(str)
            myStreamReader.TextFieldType = FileIO.FieldType.FixedWidth
            myStreamReader.FieldWidths = width_
            While myStreamReader.LineNumber > -1
                current_line = myStreamReader.ReadFields
                data.Add(current_line)
            End While
        End Using
    End Sub

End Module
VB syntax makes my head hurt, but the above works

Last edited by Dustin B; 20th May 2010 at 12:20 AM.
  Reply With Quote
Old 20th May 2010, 01:00 AM   #22
gedlee is offline gedlee  United States
diyAudio Member
 
gedlee's Avatar
 
Join Date: Dec 2004
Location: Novi, Michigan
What do you write in?

I am moving to the .NET environment and I find VB.net quite straightforward. But I have some C++ code that I want to use and I cannot get the C++ Dll's to work - I know its the "managed code" stuff, but that's all fog to me. I started looking at C# and I can see that I could really take to that language, but I find C++ completely discouraging and not at all apparent what is going on.
  Reply With Quote
Old 20th May 2010, 03:16 AM   #23
diyAudio Member
 
Join Date: Mar 2005
Location: Saskatoon, Saskatchewan, Canada
I spent a lot of time in C# using the .net framework (first job out of university was web programming in C#.net), but I haven't really used it since .NET 3.5 came out. I greatly prefer C# to VB. I could get used to VB I'm sure, I've just never done much of anything in it.

Spent 6 months or a little more in Java, then a year not coding, and now I'm mostly working in Python. Always thought it would be crazy to leave a strongly typed language, but I'm really starting to like a dynamically typed language like Python. Code ends up so clean and concise.

If you switch over to C#, check out JetBrains ReSharper. It's a must have in my opinion.

And if you end up more seriously developing your plotting tool, I'd strongly recommend checking out a book called Clean Code and doing some reading on TDD (test driven development). Pain in the *** to get your head around the TDD paradigm, takes a while to figure out what tests to write. But once you do, you end up with fewer bugs, and you can re-factor your code fearlessly with the confidence a full suite of test coverage provides.

Last edited by Dustin B; 20th May 2010 at 03:25 AM.
  Reply With Quote
Old 20th May 2010, 03:24 AM   #24
diyAudio Member
 
Join Date: Mar 2005
Location: Saskatoon, Saskatchewan, Canada
With changes the app is working fine for me. Takes a couple seconds to load a new dataset.

You might also want to consider zipping the datasets. The System.IO.Stream name space includes some that will decode gzip files. And there are some free libraries for doing zip files. Should save on bandwitch and speed up the data set switching time.

Could set it up so that it pulls in all the datasets in a zipped format, then keeps them all locally in memory for switching between them, which should make changing between the plots almost instant.
  Reply With Quote
Old 20th May 2010, 03:49 AM   #25
gedlee is offline gedlee  United States
diyAudio Member
 
gedlee's Avatar
 
Join Date: Dec 2004
Location: Novi, Michigan
Yea - thanks a lot - your code worked great.

Good idea about the zip thing.

Trouble is that I DO NOT want to become a programmer. I'm a hack. But there are some things that I have to do myself. I was using a plotting package for the polar maps and it won't run under Win7. I got sick and tired of buy new plotting packages every couple of years so I wrote this one to play with my new VS2008. It was really very straightforward. But I have no intention of getting too deep in any of this.

I need to do some extremely heavy numerical stuff and I can't get FORTRAN to work in WIN 7 either. So I thought that I would jump to VS C++, but I just got frustrated. I'm still not sure what I am going to do. I'd prefer to work in FORTRAN, but thats getting darn near impossible.

Thanks again.
  Reply With Quote
Old 20th May 2010, 04:14 AM   #26
taj is offline taj
diyAudio Member
 
taj's Avatar
 
Join Date: Feb 2005
I don't imagine you'd want to go this route, but I found Adobe Flex to be a very easy-to-digest language for muckin around in. And since it targets the flash player, it's pretty much compatible with everthing (okay, except Apple iDevices). This little program I am playing with is about a page and half of (horrid beginner) code. Flex is most similar to JavaScript I think.

please 'scuse the simplicity, but it demonstrates the capabilities a bit...

Spoddler: A Speaker Modeler

(and 'scuse the vain URL -- it's a freebie host.)

..Todd
  Reply With Quote
Old 20th May 2010, 04:59 AM   #27
diyAudio Member
 
Join Date: Mar 2005
Location: Saskatoon, Saskatchewan, Canada
I don't know what Python has for math libraries, the programming I do doesn't require much and I didn't take that much math in university. But I've found it amazing how quickly you can hack stuff together in Python.

Here's a link to a wiki page on the libraries available in Python:
NumericAndScientific/Libraries - PythonInfo Wiki

Here's an online book that would have you up and running in Python in a couple hours.
Dive Into Python
  Reply With Quote
Old 20th May 2010, 02:59 PM   #28
gedlee is offline gedlee  United States
diyAudio Member
 
gedlee's Avatar
 
Join Date: Dec 2004
Location: Novi, Michigan
Quote:
Originally Posted by taj View Post
I don't imagine you'd want to go this route, but I found Adobe Flex to be a very easy-to-digest language for muckin around in. And since it targets the flash player, it's pretty much compatible with everthing (okay, except Apple iDevices). This little program I am playing with is about a page and half of (horrid beginner) code. Flex is most similar to JavaScript I think.

please 'scuse the simplicity, but it demonstrates the capabilities a bit...

Spoddler: A Speaker Modeler

(and 'scuse the vain URL -- it's a freebie host.)

..Todd
Over the years I would have to rate Adobe as the premier software company because there stuff is so stable, the apps so common and functional. So I would be tempted. But I am shackled in legacy, which dominates everything that I do. I can save months to years in a project by using legacy numerical code and just writting a GUI front-end, but that legacy code is all in FORTRAN. That makes things very difficult because its becoming nearly impossible. But I have not given up. The biggest problems come from two OS changes; .NET and 64-bit. FORTRAN has trouble with both of these changes, but I can see that it can be done.
  Reply With Quote
Old 20th May 2010, 03:05 PM   #29
gedlee is offline gedlee  United States
diyAudio Member
 
gedlee's Avatar
 
Join Date: Dec 2004
Location: Novi, Michigan
Quote:
Originally Posted by Dustin B View Post
I don't know what Python has for math libraries, the programming I do doesn't require much and I didn't take that much math in university. But I've found it amazing how quickly you can hack stuff together in Python.

Here's a link to a wiki page on the libraries available in Python:
NumericAndScientific/Libraries - PythonInfo Wiki

Here's an online book that would have you up and running in Python in a couple hours.
Dive Into Python
Thats a trivial set of math capabilities and most are just wrappers around C++ libraries. So Python doesn't solve anything for me since its not the "python" side of the situation that I am having trouble with and it cannot do the side that I am having problems with.

I was reading about C# and I see someting that I had not seen before about "managed code". A FORTRAN dll cannot be "managed code" so to be called from any .NET application is not trivial. Under VB6 it was - one line of code - done!
  Reply With Quote
Old 20th May 2010, 03:23 PM   #30
diyAudio Member
 
Join Date: Mar 2005
Location: Saskatoon, Saskatchewan, Canada
I've never really had to do it, but there is the option of running unmanaged code from within .NET managed code. This would be how you could make calls to c or fortran libraries.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plotting a curve for a Tractrix Horn in Adobe Illustrator with Javascript. jpbturbo Multi-Way 8 29th July 2013 11:03 AM
Plotting the graph nicholas1113 Solid State 1 21st May 2011 04:04 PM
plotting load-line for OTL amp? cbutterworth Tubes / Valves 2 19th December 2007 09:41 PM


New To Site? Need Help?

All times are GMT. The time now is 05:37 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2