|
|
#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
Last edited by Dustin B; 19th May 2010 at 11:20 PM. |
|
|
|
|
#22 |
|
diyAudio Member
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. |
|
|
|
|
#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 02:25 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. |
|
|
|
|
#25 |
|
diyAudio Member
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. |
|
|
|
|
#26 |
|
diyAudio Member
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 |
|
|
|
|
#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 |
|
|
|
|
#28 | |
|
diyAudio Member
Join Date: Dec 2004
Location: Novi, Michigan
|
Quote:
|
|
|
|
|
|
#29 | |
|
diyAudio Member
Join Date: Dec 2004
Location: Novi, Michigan
|
Quote:
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! |
|
|
|
|
|
#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.
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plotting the graph | nicholas1113 | Solid State | 1 | 21st May 2011 03:04 PM |
| Plotting a curve for a Tractrix Horn in Adobe Illustrator with Javascript. | jpbturbo | Multi-Way | 4 | 17th February 2010 02:20 PM |
| plotting load-line for OTL amp? | cbutterworth | Tubes / Valves | 2 | 19th December 2007 08:41 PM |
| New To Site? | Need Help? |