Link to a good post about Threading.
http://thevalerios.net/matt/2008/06/multithreading-and-concurrency-in-net/
Searched all over the net to NOT have to write another CSV Parser. I want to just say 'go do it now, no complaining just go'. I was happy to have found somewhere along my search the Microsoft.VisualBasic.FileIO.TextFieldParser.
Works great for what I needed with no worries about line length, terminators, etc. I also did not have embedded commas in my file.
Adios!
Private Sub walkTheCSV(ByVal fileName As String)
If (String.IsNullOrEmpty(fileName)) Then
Return
End If
' check if it exists, etc.
Using tp As New TextFieldParser(fileName)
tp.TextFieldType = FileIO.FieldType.Delimited
tp.SetDelimiters(",")
Dim currentRow As String()
While Not tp.EndOfData
Try
currentRow = tp.ReadFields()
For Each currentField As String In currentRow
If (String.IsNullOrEmpty(currentField)) Then
Continue For ' do not care to process an empty field
End If
Next
Catch ex As MalformedLineException
' eat it or move on...
End Try
End While
End Using
End Sub
Just for me to find later.
http://geekswithblogs.net/krunalm/archive/2008/12/07/nice-links.aspx (post creds)
http://john-sheehan.com/blog/net-cheat-sheets/
I knew that I had a penchant for making nasty code better, but I did not realize how far my sickness had progressed. I spent the last couple of days taking a copy/paste VB6.NET (no that is not a missprint) website apart with a scalpel provided by the free DevExpress Refactor! and paid JetBrains R#.
I like the usefulness of both tools. R# does not seem to suffer from the same memory problems as Refactor! more than likely because it creates temp files in the project directory.
I wonder if there is a job out there that I can just refactor old code to make it more efficient and pretty? I would also like the opportunity to train other developers in NOT being fearful of refactoring code.
Here is to washing out the ByRef string parms in function definitions with bleach! May they trash the Intern pool no longer.
rusty
I had a really good boss once that took the time to make me better than he found me. I am not sure what he initially saw in me because I was always a strong-willed-arrogant-stab-you-in-the-front-know-it-all-dont-like-others-my-way-or-highway kind of person.
I very easily alienated others and hit bricks walls without knowing they were there... I knew what needed to happen, but always seemed to find the wrong way to go about it. At any rate over the course of several years he mentored me to the point that I know have the business knowledge to wade deeper in the cesspool and still come out clean. I have not changed so much as I know how to use my skills more wisely to give the business what they want; therefore, getting what I want too.
I recently changed jobs and am continually faced with new opportunities to further hone my skills. The only bad thing is that I see how I used to be by watching others make the same mistakes and them not knowing why. I would say that 70-75% of the developers I know do not know how to carry themselves in a professional manner.
They either are too geeky to relate to others or they will not step off their pedestal long enough to realize they are missing out on so much (could be lack of oxygen).
Something simple like answering the customer's questions to the best of your knowledge like oh maybe an estimate or what did you do last week! Too many people want to hide what they are doing by being evasive and thinking they are getting away with something. WAKE UP! You are only harming yourself by fearing change and full disclosure. I know devs that do not want to watched while coding because of fear.
I say let's co-develop so you CAN see my mistakes and maybe I can get better. If you know you need help, do not try and hide it because you really aren't anyway. People are very intuitive and know without being told what you are trying to hide.
Be courageous and willing to open yourself up to others, you may find something you did not know you were missing. LIfe is a test that you will not survive, be willing to test and be tested daily.
rusty
I find it amazing what people choose to read of my sparse blog posts. The number one hit of mine is a post about being a newb using the Infragistics Ultrachart. I essentially posted it for my own safekeeping so that when I came back to it later, I didn't have to dig too deep in the page file to recollect any insight.
That one post has literally been around the world from Germany to Pakistan to Taiwan. Simply amazing. I hope at least one person found it useful. I need to start being a good steward and post on other people's blogs when they helped me since it might encourage them to get writing.
http://geekswithblogs.net/Rusty/archive/2008/09/26/infragistics-ultrachart-newbie-insight.aspx
rusty.
When using the Ultrachart I have found only through pain that I was trying to do too much too fast. Here are a few insights I have into using the Ultrachart.
There are different 'levels' of usage in order of your understanding that is required. I will refer to Design-Time Creation and Run-Time Creation by my acronyms DTC and RTC respectively.
Choose one method (you still pick the type of chart(s) you want).
- DTC Simple Chart
- DTC Composite Chart
- RTC Simple Chart
- DTC Composite Chart
Then work your way down until you get the results you want.
- DTC Data Binding
- RTC Data Binding
- RTC DataPoints
- RTC Handling Render/Draw events
On top of the choices above, you also have a choice of rendering. A note as well (unless a later update fixed this) the results can be very different and the same setup may not work with both methods.
- Drag/Drop Rendering
- Image Rendering (chart.SaveTo a Stream)
Depending on your needs, start very small and use the DTC in a simple way to peak into what is going on under the covers. Binding is not always a good thing unless you transform the real data into exactly what you want. I had a little bit of reuse of the data containers so I massaged them into other objects to make the charting easier.
I ultimately ended up with a RTC Composite Chart (column and scatter) using Datapoints and IRenderLabels with Infra 6.3. It was an extremely frustrating process and yet rewarding. I had an advantage that I already had an example of what the customer wanted in Excel so I could reverse engineer what Excel did to help guide me.
I still think using a toolkit is better than rolling your own unless you are a really good charting/drawing person and have the time to make it nice. No matter what you use it will feel like it is lacking. I am so tired of reinventing the wheel only to find my wheel is not any better than the one I could have bought for cheaper (accounting for my time).
If you are wanting a learning experience then by all means have fun, otherwise, make the customer happy and satisfy your curiosity after implementation!
Here is another post of mine about the Ultrachart that might be helpful (
link).
Updated: Adding
link for future reading.
Updated: 2008.10.01
rusty
Wow, it has been quite a struggle getting up to speed with charting in general and Infragistics specifically. One enhancement that would be great would be to have a flag to flip on that would at runtime give you output telling you all the ways you have incorrectly setup everything.
Without this
link which I stumbled on even after a friend mentioned it a couple of days prior, I would not have know what was going on.
Ok, I had a NumericTimeSeries setup for a Column chart (in this case I was using a Composite charttype with a Column and Scatter) which is NOT ever going to work no matter how many times you debug! I try to only change 1 to 2 things at a time to minimize the risk of freaking something out. It still took me quite awhile to determine it was my mistake.
So on the one hand, I am thankful that the UltraChart did not crash and burn which would have been more confusing; however, on the other an option to have the chart tell me what I did wrong would also be helpful.
So here is to the hope that the Ultrachart could tell me that I am stupid in a nice way only when I want it on Tuesday but not in front of the customer...
rusty
Here is the thing, I sitting here on someone's backdeck talking to myself (blogging) while my wife attends a purse buying party. I am perfectly fine sitting here tapping away on my iPhone without any remorse for the lack of social commentary. Have I always been this way or has tech let me become anti-social?
I think in my case it allows me to be more alone in a crowd than before because I look busy. On the other hand, I feel I have a better relationship with more distant friends or relatives due to tech. So I don't think matters either way. Even than Amish have their communication issues.
There is a really good show called NextWorld on Discovery or some other channel that is really good. I enjoy seeing the far out things that literally we can do, but the "we" is limited to either the rich or the few scientists that created the ability. I want a pair of the HUDs contact lens. I like the idea of seeing an overpay of whatever I want. It would make meetings much more fun. In fact, I would not mind the whole Matrix thing if not for the slavery thing. Well, off to plunder the treasure trove of google reader while I wait to see what I bought today. I hope it isn't too girly! rusty
I recently battled brittleness of a test project I created to provide some demo data and charting for a customer. I would make a change to one section and then duplicate (yes, I said it) to the other demos.
This went on for a couple of days due to me justifying that it was just a demo. I finally had had enough and questioned "Why am I doing this?" only to find that I had let fear of refactoring control me. I was shamed into admitting that I fell into the same trap that I chastise others about. So I found a good article (link http://www.infoq.com/articles/RefactoringMyths) and decided to comment on a few points to make myself feel better.
Refactoring can be applied as a separate stage in development process and performed by separate team I have mixed feelings concerning this point. I for one thoroughly enjoy refactoring another devs code especially when I know little about it. As to it being a separate stage of the process, I am not sure. A few shops make statements that they perform code reviews. I have only witnessed code reviews as a tool for HR, nothing more.
Not relying on comments can't be right I must agree with the author... I hate writing comments and only do so when absolutely necessary depending on if I am trying to demonstrate a better way to do something for junior programmers or using a new technique that I know has not been used in any other codebase. If a developer cannot understand what my code is doing by 'reading' it, then I have failed to hold up my end.
To take the comment thing further, I contend that once you start heavily refactoring the comments become meaningless and should be deleted. I even struggle with triple slash comments becoming out of date so I simply remove them. Granted, my work currently is not framework creation or maintenance.
I had added some comments above a different way to perform CRUD operations against a database for some of my fellow devs in code. After I did so, I had a question along the lines of 'hey, why doesn't this work. I followed your comment'. I looked at the code in question and yes my comment was followed to the letter. The problem was that the signature of the particular method they were trying to use was wrong.
So where do comments cripple people from taking the step of actually learning what they are attempting to use?
rusty