Posts

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 mas...

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 ; }        ...

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 ...

Friday rant

First time for this but needs to be out there as we as a community can do better to educate novice coders who might someday be tomorrow's developers. Novice coders (note I will be call them developers), many times will ask “what is wrong with my code”, I tell them, provide a better solution and they come back with “but that’s over my head, can you explain that in detail?” or “can you make my code work?” Well in the first case “over my head”, I wonder why they don’t read Microsoft documentation? Then in the second case “make my code work”, well if it was decent code that would be me telling them how and if stuck come back and explain. Just yesterday I provided a solid solution but the asker refused to use it because I would not fix their code. I said, it’s going to be a while until you get someone to fix your code and I was right, going on 20 hours and generally speaking less answers are done on weekends. How can this and similar situations be remedied? Have them read the docu...