Posts

Coders asking questions in online forums

 Something I've noticed over the years answering questions on various forums is They want someone to adjust their code which is in many cases complete off-base They want simple where simple is not always the case or that what they believe is hard in regards to me supplying a code solution that I see as simple. My solution usually will become simple only if they invest time to study the code rather than look at it and say jess that is over my head. What can be done?  There needs to be for instance a better way to direct these coders to content on the web starting with Microsoft code examples e.g. for C# for instance , Pluralsight, Microsoft TechNet. Where to place this? Perhaps on startup pages for Visual Studio and Visual Studio Code. Coders need to have an incentive to be better and that can only happen with placing learning pages where they are easy to locate and for community leaders e.g. MVP's for instance to stop providing code that works with things like one character var

We can do better with forum responses

It is inevitable in any developer forum that members who have low quality solutions to a posted question where the person asking many times will accept low quality solutions when they do not know any better. I have noticed members in the new Microsoft Q&A forum who tend to post as per above will accumulate points and be labeled “community experts” which detracts from members who post often with quality responses. Not much can be done when the person asking a question takes a low quality response. A good example is using an Object for a property, parameter to a method, returning an object etc. when a strong typed item is used rather than type Object. The only solution and this may not fair well with the community is to point out decencies in poor responses to a question. Hopefully this will happen but doubtful. 

Dialogs for web solutions mobile friendly

Image
Introduction When building mobile friendly web solutions I needed a language agnostic solution and went with BootBox JS . Example of a simple alert that is setup  Code sample      $ ( '#simpleBootBox10' ). click ( function  ( event ) {          bootbox . alert ({  message:   "Example for positioning" ,  centerVertical:   true  });     }); Here are several examples Source code : GitHub repository .

GitHub download partial repository

There may be times when a developer wants one or two projects from a GitHub repository rather than downloading the entire repository. Prerequisite Git needs to be installed which can be download here . Double click on the file once downloaded. Under options select Windows Explorer integration. Follow through with the remaining options/prompts e.g. select an editor etc. Downloading one or more projects Select a GitHub repository url and the folders to download. For example, the repository https://github.com/karenpayneoregon/code-samples-csharp There are two projects, Events_1 and ExceptionHandling (which Events_1 project references). Create a folder on the computer, create a batch file with the following commands. mkdir code cd code git init git remote add -f origin https://github.com/karenpayneoregon/code-samples-csharp git  sparse-checkout init --cone  git  sparse-checkout add Events_1 git  sparse-checkout add ExceptionHandling git  pull origin master Run the batch file, copy the f

C# Thinking outside the norm

Image
Introduction Had a forum question today where a developer wanted to load a TreeView in Windows Forms were data was read from a database and in turn caused the user interface to become unresponsive. They asked about BackGroundWorker component or asynchronous way (async/await task) but had never worked with any of these. My solution Since the idea is to use a delegate/event this path will work on any control ranging from TreeView to ListView or DataGridView the example given uses a ListView. Start off with a class which represents returning data. using  System; namespace  IteratingCodeSample.Classes {      public   class   Countries     {          public   int  CountryIdentifier {  get ;  set ; }          public   string  Name {  get ;  set ; }          ///   < summary >          ///  Provides easy way to add a country to a ListView          ///   </ summary >          public   string [] ItemArray =>  new []         {             Name,              Convert .ToString(Co

VS Code with Cold Fusion - SVN and FTP'ing

I work for a state agency where the main programming languages are C#, PLSQL and Cold Fusion. Before I transfered to this agency and to this day the Cold Fusion developers have been using Aptana editor. Aptana was selected because when the developers where looking for an editor one requirement was to push the active file to the development server. When I was called for writing code for Cold Fusion I would write JQuery and CSS in Microsoft Visual Studio and only use Aptana for Cold Fusion native code and really disliked using Aptana. This week I installed VS Code with several extensions coldfusion for working native cold fusion SFTP for transfering file(s) to our development server SVN to do source code management along with TottoiseSVN Then for a warmer feeling installed the following extensions vscode-icons VS Color Picker It was nice to have the support of die hard Aptana developers eager to move to VS Code woohoo. Visual Studio is still my editor for all coding other than cold fusi

VB.NET Working with Delegate and Events

Introduction From hobbyist to seasoned developers delegates are avoided or attempts are made to understand them, which in many cases is met with frustration. I see questions on various forums where code could be refactored by using delegates and when making suggestions to use delegates generally the response is something like “that is over my head, what I have works!”. Well just because code works does not mean there is room for refactoring. Search the Internet for VB.NET delegates and find out there are an abundance of post while the majority are not fully working examples and may be untested which can lead back to frustration. The first mistake some coders make is not reading Microsoft documentation on delegates or think outside the box and study C# code samples and a decent C# to Visual Basic converter as there are more code samples in C# than Visual Basic. One must understand that there are cases like with MulticastDelegate class there is syntactic difference on how to use them