Posted by robkraft on March 31, 2013
Once in a while I take over a software development project that is not using source code control. If I expect to make a lot of changes I usually set up source code control before I start so that I can easily revert changes I made if I need to. I don’t do this often, so I’m documenting the steps for a quick installation of subversion with minimal source control features for my own future reference.
I felt the urge to write this post for two reasons:
- To easily find the correct URLs to use to download the software
- To provide simple documentation for a simple installation. There is a lot of good extensive documentation explaining all the options, but I don’t care about most the options. I just wanted the basic installation so that I can get to work. And here it is.
Downloading and Installing the Version Control Software
A Google search for subversion will almost certainly take you to the old web site for subversion. So skip it. Download subversion from here: http://www.visualsvn.com/downloads/ The first link is probably Apache Subversion Command Line tools, version 1.7.8 and about 2MB. That is the one you want. Ignore the misleading fact that it is has Apache in its name. As a windows developer, that information is irrelevant, and frankly, misleading. Download the file and unzip it to c:\program files\subversion.
Subversion does not include a user interface. Everything is done from a command line. So let’s get a user interface for subversion so that we can avoid hours making typos at the command line. The challenge is to download TortoiseSVN without downloading the other crap put in front of you on the web pages. This is not easy because huge download buttons will be placed in front of you on most the pages they force you to navigate through and they all download crapware. So avoid the tortoiseSVN site and go straight here http://sourceforge.net/projects/tortoisesvn/files/latest/download. This will download either the 64bit or 32bit version based on the OS you are running your browser. Download it, then run the installer exe. Take the defaults.
Creating a Repository to Store the “Master” copy of your software.
Now for the hard parts. Subversion uses poor terminology, in my opinion, for the actions you need to take to get started. Conceptually, we want to do the following:
- Create a place on the computer to store the “Master Copy” of our source code, called the repository.
- Upload our existing source code into the repository
- Flag the working directory of our source code as a working directory for that repository.
- Make a change, test that subversion recognizes the change.
I recommend you back up your source code root folder to a backup folder at this time.
Create a folder on your computer to contain the Repository. This is not going to contain the “working copy” of your code, it will contain the “Master” copy. I recommend something like c:\SVNRepository.
- Right click on the folder you just created. The TortoiseSVN tools should provide you an option to “TortoiseSVN\Create repository here”
- Do NOT click Create Folder Structure, just click OK.
- Now go to the root folder that holds your source code (let’s assume it is c:\DevSource). Right-click, choose “TortoiseSVN\Import”
- Clear the “URL of repository, then click the … button to the right”. Navigate to the folder of your repository (c:\SVNRepository)
- Click ok
- Now, to designate the location you imported from as the working copy of your project, right click on the folder you imported from again, and select SVN Checkout
- Careful – the “URL of repository” should be the full path to c:\svnrepository
- You may need to change the defaulted value for Checkout directory because the UI may add svnrepository at the end of the path name. Take that off. The checkout directory should be the root level of your project folder (c:\DevSource)
- It will warn you that the folder is not empty. This is good – you are going to overwrite your existing project files with the files you imported into the repository.
- If you did this correctly, all your files will still contain their original date/times.
- If you did this correctly, and you right click on your project root folder, you will have two new options above TortoiseSVN on your menu, SVN Update and SVN Commit:
If you had any trouble, delete SVNRepository, copy the backup you made of your source files back into your project folder, and try again.
Posted in Dev Environment | 4 Comments »
Posted by robkraft on March 8, 2013
Last October I blogged about using Fiddler to Post to a REST API. Today’s post is very similar but I go one step further and post to a REST API site that requires Basic Authentication. When making a POST to a site requiring authentication, you must include authorization information in Request Header. Sounds simple enough, until you look at an example. In Fiddler, it looks like the image below:
The only piece of information you need to add to make Basic Authentication work is the Authorization: Basic line with the correct encoded value following it. Despite my warning, this encoded value is easy to generate. You just need to go to any web site that will do base64 encoding for you, plug in your logon and password using this format:
Click the button to encode to Base64 (probably UTF8), and paste the resulting value into Fiddler. I did this at http://www.base64encode.org as shown here:
Image of Base64Encode.org web site
Posted in CodeProject, Coding, Free tools | Leave a Comment »
Posted by robkraft on March 6, 2013
When catching and re-throwing an exception, you should include the original exception as a 2nd parameter. Including the original exception may provide a deeper stack trace that will assist you with solving the exception.
This syntax may not include the full stack trace.
In the code above, if an error occurs in methodWithoutCatch(), the call stack returned will show “methodWithTryCatch” as the deepest method in the stack.
System.Exception: Additional Error Info: blah blahObject reference not set to an instance of an object.
at WindowsFormsApplication6.Form1.methodWithTryCatch(String y) in ...\Form1.cs:line 34 at WindowsFormsApplication6.Form1.button1_Click
This example will include the full call stack.
However, if you include the original exception in the throw as shown in the second throw example, then the call stack returned will show “methodWithoutCatch” as the deepest method in the stack.
System.Exception: Additional Error Info: blah blahObject reference not set to an instance of an object.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at WindowsFormsApplication6.Form1.methodWithoutCatch(String z) in ...\Form1.cs:line 40
at WindowsFormsApplication6.Form1.methodWithTryCatch(String y) in ...\Form1.cs:line 29
--- End of inner exception stack trace ---
at WindowsFormsApplication6.Form1.methodWithTryCatch(String y) in ...\Form1.cs:line 35
Including the original exception as the second parameter of your new exception provides you with a better call stack. In this example, it allows you to determine that the error occurred in the methodWithoutCatch method. In the first case, you are left wondering if the methodWithTryCatch really caused the error, or if one of the three methods it called (method1, methodWithoutCatch, or method3) caused the error.
Posted in Code Design, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010 | Leave a Comment »
Posted by robkraft on March 2, 2013
I am loving the speed of the recently released Internet Explorer 10 (IE10) for Windows 7. It is noticeably faster than Chrome. It also has no problem rendering video and other content on sites that IE9 struggles with.
A few other minor improvements are nice such as the little ‘x’ added to every text box to allow you to clear the field and the icon for viewing your password that appears in every password protected field. This is a long overdue security enhancement. A lot of users choose simple passwords primarily because they struggle typing complex passwords when they cannot see what they have typed.
Text fields and some fonts render a little differently in IE10 than in IE9. I don’t think they look better, but I think they probably render a little faster. Once again, IE10 appears to be all about speed!
Posted in Free tools, Home Tech, I.T., Web Sites | Leave a Comment »
Posted by robkraft on January 15, 2013
The software we write is used by many clients. Each client uses a different set of features. Clients can’t enable features they have not paid for, but we discovered that clients can change some of the configuration options for features they have not enabled, and configuring some options for disabled features will cause bugs to occur. Fixing this problem would require days of refactoring, coding, and testing. It is unlikely any clients will ever encounter the bug, and the impact of the bug is minimal.
- Should we issue a service pack right away that fixes this problem?
- Should we fix it in our upcoming release?
- Should we fix it in a future release?
- Should we never fix the problem?
This challenge is typical of the decisions that need to be made every day in software development. I don’t believe there is a correct or best answer to this scenario.
- The policy in some software development shops is to fix every bug as soon as it is discovered, but is that the best use of developer time?
- The policy in some software development shops is to delete the bug from the bug tracking system if you don’t plan to fix it soon because you will probably never get to it. Is it more valuable to keep a record of the bug in the backlog in case it comes up again or is it more valuable to delete it from the backlog so that no one wastes time re-evaluating if it should be worked on?
There are many factors that go into making this decision and I’m sure I cannot think of all of them. Can you?
Posted in Project Management | Leave a Comment »
Posted by robkraft on December 17, 2012
I have several e-mail accounts hosted by Google, which is fortunate because it helped me solve this problem. I had set up my organization’s email account, hosted on Google, using the settings I used in my Windows 7 phone. Those settings looked like this, but did not work on my Windows 8 phone:
- User Name: admin@MyDomainName.org
- Server: m.google.com
- SSL: Checked (Yes)
But to get that to work on my Windows 8 Phone I had to switch the account to the IMAP settings. To do this, delete your account settings on your Windows 8 Phone because you need to set them up in a way that allows you to choose IMAP4. Create a new account with these settings:
- Account Name: really doesn’t matter
- Email address: admin@MyDomainName.org
- Incoming email server: imap.gmail.com:993:1
- User Name: admin@MyDomainName.org
- Outgoing (SMTP) email server: smtp.gmail.com:465:1
- Outgoing server requires authentication: Checked (Yes)
- Use the same user name and password for sending email: Checked (Yes)
- Advanced settings:
- Require SSL for incoming email: Checked (Yes)
- Require SSL for outgoing email: Checked (Yes)
When you do this on your phone:
- Pick “add an account”
- Pick “other account (POP and IMAP)”
- Enter the Email address and Password and click Sign In. It will fail.
- Click “try again”. It will fail again, but then you will get an “advanced” button where you can enter the information above.
Posted in I.T. | 5 Comments »
Posted by robkraft on November 12, 2012
We have a developer, I will call him Rob, who writes many utility programs and rarely works on the main product with the other developers. One of the utility programs needs a new feature to allow our customers to see, modify, remove, and add items to a list. Rob shows all the data in a grid, and needs to allow customers to add items to the grid. This could be done in two hours by placing an add button on the form. But Rob wants to use the add feature built into the databound grid.
We all agree that the utility will look better if the add is done in the grid instead of a using a button, but we also estimate five days instead of two hours to get it to work. This means Rob will not be able to work on a few other features for the release. However, Rob is likely to hold a grudge for years if not allowed to write the code using databinding to get the aesthetic look he desires.
Should we allow Rob to take the extra time to write the code that will be more pleasing to the customers, and to Rob; or should we require Rob to write the code more simply so that additional customer requested features can be included? If we choose the better user interface, we must leave some features out of the release.
If we choose more features, we risk questions from our customers like, “Why didn’t you just allow us to do the add in the grid”, and we also risk displeasing Rob.
Should our decision favor the needs and desires of our customers, or the needs and desires of our developers?
Posted in Coding, Project Management | 1 Comment »
Posted by robkraft on October 30, 2012
The software programmer has added a feature to the program as requested but the feature contains a minor flaw. The programmer has spent four hours trying to eliminate the flaw with no success. As shown in the images, the flaw is a visual flaw. When the screen is resized to a smaller size, one of the input fields vanishes. But any subsequent resize causes the missing field to re-appear.
Should the programmer continue to fix the flaw? None of the programmers has any ideas for how to fix the flaw, they have already researched and tried everything they can think of. No time estimate can be made for the fix; it might take 2 hours or it might be impossible to fix.
Your software has 5,000 users, but you estimate this feature will be used about once per day by 10 of those users on average, and if those users don’t resize the screen they won’t notice a problem.
- Do you have the programmer continue to work on the flaw for 8 hours and then re-assess the issue.
- Do you have the programmer spend 40 hours redeveloping the feature completely in a different way that hopefully will have no problems.
- Do you remove the feature from the code hoping to try to implement it again in a future iteration?
- Do you create a new ticket in the bug tracking system to address the problem in the future, or do you leave it unrecorded and hope it is never reported.
- If you create a new ticket in the bug tracking system, do you include the bug in the list of known bugs in the application?
- Do you tell your quality assurance team to ignore the bug; to not report it as a bug.
This challenge is typical of the decisions that need to be made every day in software development. I don’t believe there is a correct or best answer to this scenario. Perhaps you have a junior programmer doing the work and you feel it would be good for him to spend a few days trying to resolve the problem. Or, perhaps the project is behind schedule and you have several more valuable features to complete so you decide to leave this one as is. Or perhaps you software has been critiqued severely lately for releasing code with bugs so you decide it best to take this feature out to reduce further stains on your reputation. There are many factors that go into making this decision and I’m sure I cannot think of all of them. Can you?
Posted in Project Management | 1 Comment »
Posted by robkraft on October 28, 2012
Businesses often turn to software and computers to solve problems and gain a competitive edge. When this occurs, both the business analysts and the I.T. staff have a solution in mind that requires computing technology and software. Sometimes though, non-technical solutions solve problems better and with far less expense. One current classic example is the use of a white board to track the project of work being done during a software development iteration. That white board does not need to be electronic, so don’t spend weeks or months creating the white board software especially when all interested parties are located in the same office or room.
Keep in mind these three principles:
- Can we try out the new process or idea manually, with minimal investment, without spending the time to develop the idea using software. If we feel the process still requires automation after a few months, can we at least learn some of the requirements from performing the process manually in the first few months.
- Is the cost of developing the software the best use of our scarce resources? If purchasing a software solution, is the cost of the purchase worth the investment? Many companies spend a lot of resources developing software that is not part of their core business. Doing so is depriving your business of the resources it could be using to better the products that really drive the business.
- Just because your software developers are busy does not mean you are making progress. I once learned of a doctor that traveled an hour between two hospitals. He saw four patients a day because he spent four hours traveling back and forth. The doctor was constantly busy, but the doctor was not near as productive as he could have been. Once the doctor changed the schedule of the patients to meet all the patients at one hospital in the morning, and all the patients at the other hospital in the afternoon, the doctor was able to see twice as many patients each day.
Posted in Process, Project Management | Leave a Comment »
Posted by robkraft on October 24, 2012
Posting to a REST API using Fiddler is very simple, as long as you fill out all the required values correctly. I spent more than an hour figuring out the correct info for my REST API recently so I am documenting it here for my own sake, and hopefully to speed the resolution for others. The URL shown in the image is not real, so don’t expect that URL to work for yourself.
- Select the Composer tab in Fiddler.
- Select POST from the dropdown.
- Enter the URL of the REST API. My REST API had a .svc extension, but most REST APIs do not.
- In the Request Headers, include “Content-Type: text/xml”. This is the step I missed that took my so long to resolve. Your REST API may not need this, but the REST API I was working with developing on the Microsoft Stack did. You do not need to provide the values for Host or Content-Length in your Request Headers because Fiddler will populate those for you.
- In the Request Body, provide the XML or Json data that you are sending to the URL as part of the POST.
- Click on the Execute button.
- Check the panel on the left (not shown in the image) to see the result of your API call. For my API, the POST returned a 200 and the Response Body contained my response data.
That’s it. Good Luck!
Posted in CodeProject, Coding, Free tools | 4 Comments »