| How | Upper | Lower | Comment |
|---|---|---|---|
| Keyboard | CTRL + SHIFT + U | CTRL + U | |
| Menu | Edit -> Advanced -> Make Uppercase | Edit -> Advanced -> Make Lowercase | |
| Command | Edit.MakeUppercase | Edit.MakeLowercase | |
| Versions | 2008, 2010, 11 | ||
–jeroen
Posted by jpluimers on 2012/09/28
| How | Upper | Lower | Comment |
|---|---|---|---|
| Keyboard | CTRL + SHIFT + U | CTRL + U | |
| Menu | Edit -> Advanced -> Make Uppercase | Edit -> Advanced -> Make Lowercase | |
| Command | Edit.MakeUppercase | Edit.MakeLowercase | |
| Versions | 2008, 2010, 11 | ||
–jeroen
Posted in .NET, Development, Keyboards and Keyboard Shortcuts, Power User, Software Development, Visual Studio 11, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2012/09/26
Notes:
Log, Ln, Lg, Log10, LogE, Ld
Common logarithm – Wikipedia, the free encyclopedia.
Exponential_and_logarithmic_functions ISO 31-11 – Wikipedia, the free encyclopedia.
Binary logarithm – Wikipedia, the free encyclopedia.
What is logarithm(log, lg, ln).
Why Use a Logarithmic Scale to Display Data Math Forum – Ask Dr. Math.
STRAIGHT LINE ON ARITHMETIC GRAPH PAPER (LINEAR FUNCTION)
http://www.humboldt.edu/geology/courses/geology531/531_handouts/equations_of_graphs.pdf
Font sizes
Five simple steps to better typography – Part 4 | Mark Boulton.
A List Apart: Articles: How to Size Text in CSS.
–jeroen
Posted in .NET, C#, C# 4.0, C# 5.0, Development, Software Development, Web Development, WordPress | Leave a Comment »
Posted by jpluimers on 2012/09/25
The below code didn’t compile during a .NET 1.1 to 4 migration.
Downstream code:
Word.Document document = app.Documents.Add(ref FileName, ref missing, ref missing, ref missing);
Upstream code (6 layers up!):
string filename = Path.Combine(ConfigurationSettings.AppSettings["MSWordTemplateDirectory"], (string)status["CoverLetter"]);
And somewhere in the middle:
public bool GenerateLetter(Word.Application app, DataRow row, object FileName, object FilePathAndName)
Downstream code:
Word.Document document = app.Documents.Add(ref templateFileName, ref missing);
Upstream code (6 layers up!):
templateFileName = Path.Combine(ConfigurationSettings.AppSettings["MSWordTemplateDirectory"], (string)status["CoverLetter"]);
And somewhere in the middle:
public bool GenerateLetter(Word.Application app, DataRow row, object templateFileName, object documentFileName)
Coincidentally, parameters are now all lowercase.
–jeroen
Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/09/20
This post describes the TFS workspace cleanup features Treeclean and Scorch.
Both are not in the Visual Studio UI nor TFS tool, but are available form the ftpt command from the optional Team Foundation Power Tools package.
The main reason you need these two features is that TFS does not always clean up after it self when you perform get latest. For instance renamed directories, as well as bin and obj directories are not automatically removed.
The tfpt command I most often use this this one:
tfpt treeclean /exclude:*.suo,*.user
This deletes files from your local TFS workspace directory tree that are not in the source control system, but skips the *.suo and *.user files.
Tfpt also allows you to scorch files from your TFS.
So my second most used tfpt command is scorch in either of the two below forms:
tfpt scorch /recursive /diff
tfpt scorch /recursive /diff /exclude:*.suo,*.user
The first form is for the automatic build environment, the second for my normal development workspace.
Below is the explanation of treeclean and scorch.
First some other great commands from this StackOverflow answer by Martin Woodward:
Not quite, however you might want to download the TFS Power Tools and check out the command line utility tfpt.exe.
The “tfpt online” and “tfpt treeclean” might be most useful to you when working outside of an integrated TFS client. tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.
Scorch does more than Treeclean.
I use Treeclean for 90% of my normal workspace work, Scorch (with exclude) for about 10% of the time in my regular workspace.
For my CCnet build integration workspace, I only use Scorch (without exclude).
Treeclean just cleans the tree of stuff that is not in TFS:
B:\MasterWorkingDir>tfpt treeclean /? tfpt treeclean - Delete files and folders not under version control Usage: tfpt treeclean [/exclude:filespec1,filespec2,...] [filespec...] [/recursive] [/batchsize:num] [/noprompt [/preview]]
Scorch does more work: at the end, both source control and the local disk situation are identical.
B:\MasterWorkingDir>tfpt scorch /? tfpt scorch - Ensure source control and the local disk are identical Your local disk will be scanned for: (1) items that are not in source control (2) items which are different on disk from the workspace version (3) items which are in the workspace but are missing on disk Items not in source control will be deleted from disk, just as with the tfpt treeclean command. Items determined to be different on disk from the workspace version will be redownloaded from the server. Items missing on disk will also be redownloaded. Items with pending changes are exempted. By default, items deleted from your local disk (#3 above) will not be scanned for, and local items are determined to be identical/different from the workspace version *solely by examining the read-only bit on the file*. To redownload items deleted from your local disk (#3 above), supply the /deletes option. To detect items which are different from the workspace version but still have their read-only bit set (+R), supply the /diff option. When using either or both of these options, tfpt scorch runs more slowly. Usage: tfpt scorch [/exclude:filespec1,filespec2,...] [filespec...] [/recursive] [/batchsize:num] [/noprompt [/preview]] [/deletes] [/diff]
The commandline options are also different.
Scorch has these extra when compared to Treeclean:
/batchsize:num Set the batch size for server calls (default 500)
/deletes Detect and replace items missing from the local disk
/diff Use MD5 hashes to compare items with source control
Treeclean can have these options:
/noprompt Operate in command-line mode only
/exclude:filespec[,..] Files and directories matching a filespec in this list
are excluded from processing
/preview Do not make changes; only list the potential actions
/recursive Switch from one level of recursion to full recursion
/batchsize:num Set the batch size for server calls (default 500)
filespec... Only files and directories matching these filespecs
are processed
Scorch can have these options:
/noprompt Operate in command-line mode only
/exclude:filespec[,..] Files and directories matching a filespec in this list
are excluded from processing
/preview Do not make changes; only list the potential actions
/recursive Switch from one level of recursion to full recursion
/batchsize:num Set the batch size for server calls (default 500)
filespec... Only files and directories matching these filespecs
are processed
–jeroen
via:
Posted in CodePlex, Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | 4 Comments »
Posted by jpluimers on 2012/09/18
Having a done a lot of Async stuff in the .NET 2, 3.x and 4 era with multimedia applications (oh, the days of SynchronizationContext), this project seems very interesting:
AsyncBridge
Adds the new C#5 async features for .NET 4 projects
Download this project as a .zip file
Download this project as a tar.gz fileWhat does it do?
AsyncBridge lets you use the VS 11 C#5 compiler to write code that uses the async and await keywords, but to target .NET 4.0. It was published by Daniel Grunwald (from SharpDevelop) here.
As an extra, I’ve thrown in the new C#5 caller info attributes, which lets you automatically add the method name, line number or file path to your code.
Authors and Contributors
Daniel Grunwald (@dgrunwald) – Original code.
Omer Mor (@OmerMor) – Turned it into a full blown github repo with the complimentary nuget.
Alex Davies (@alexdavies74) – Wrote the blog post that inspired this, and is actively improving the code.
–jeroen
via: AsyncBridge.
Posted in .NET, .NET 4.5, C#, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/09/13
It was a long time ago that I ever did something with the Elf proef.
It is the algorithm that is used to calculate the check digit for Dutch bank account numbers (bankrekeningnummers) and a variation for BSNs (Social Security Numbers).
I needed it (or more exactly: a variation of it) in order to support anonymization of customer data for the DTA/OTA portions of a DTAP/OTAP environment.
So, I started reading on the Elf proef, and getting some sample data to setup some unit tests.
Wrong and wrong:
To start with the latter, they get it wrong because the check digit is modulo 11 (like the ISBN 10 check digit), but only numeric digits are valid. Their bank.js algorithm module tries to accommodate for that in the wrong way.
In addition they copy-pasted code between their other number generation algorithms which you can see form the variable SofiNr which is an abbreviation for SofiNummer, the old name for the Dutch Social Security Number (now called Burgerservicenummer aka BSN).
Their generated sample 290594880 is wrong because the check digit should be 10, and 10 is not a digit. Their generated number 936977590 is OK as the check digit should be zero (0) which it is.
More on their fault a bit further on. First lets concentrate on getting proper test data, and the right algorithm.
I will cover code for the bankrekeningnummer here. The complete code including BSN is at BeSharp.CodePlex.com. Read the rest of this entry »
Posted in .NET, C#, C# 3.0, C# 4.0, C# 5.0, Development, JavaScript/ECMAScript, Scripting, Software Development | 4 Comments »
Posted by jpluimers on 2012/09/11
A few on-line code fragment conversion tools that I have come across in the past:
–jeroen
Posted in .NET, C#, Development, Python, Ruby, Scripting, Software Development, VB.NET | Leave a Comment »
Posted by jpluimers on 2012/09/06
So I won’t forget: .NET Framework Libraries.
It contains the download links, setup instructions (for debugging, troubleshooting and source/symbols downloading) and licensing information.
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2012/09/06
A while ago, I blew quite a few Visual Studio Solution and Project builds because I was experimenting in a suite of solutions with the Configuration Manager adding other Solution Configurations than Release and Debug, and mixing x86/AnyCPU platforms to facilitate Debug & Continue.
Lesson learned: don’t do that!
Keep it simple:
- Keep your Solution Configurations at Release and Debug,
- Perform conditional defines in your automated build server,
- Limit the mixing your platforms to a minimum.
We noted the anomalies a little late in the process (in retrospect, when taking over the solution suite, we should have started with setting up and Build Automation right at the beginning, then fix all the solutions that came from Visual Source Shredder, but alas: you are never too old to learn from your mistakes).
The anomalies were spurious (and hard to reproduce) build failures at developer workstations, wrong builds of assemblies ending up on the final build directories and more. And best of all: Visual Studio not failing, warning or hinting upon most issues.
The history in the version control system was not helpful enough to assist in fixing it, so the fix was this:
The last step is a lot more complex, because of a couple of reasons:
My workaround was as follows:
Finally, I get to the title of this blog entry: Visual Studio will always generate a directory when creating a Blank Solution, and does not support creating an Empty Solution in a directory.
There are many posts describing how to workaround this, but the actual downloads are usually gone because of link rot (Jakob Nielsen’s alert from 1998 still is totally right about it). Thanks to they webarchive.org WayBackMachine though for keeping some of them alive.
So I went with Peter Provost’s solution, and amended it from Visual Studio 2005 to all Visual Studio versions that support .NET that I have used or still use: 2002, 2003, 2005, 2008, 2010 and 2012 a.k.a. VS11.
All files are in Change set 89386 on BeSharp.CodePlex.com.
His solution uses the ShellNew command for .sln file extensions that is stored in the registry:
ShellNew is versatile, so you can also embed the fresh solution file into the .reg file, see this ShellNew article for a few nice examples.
Note that generating a new ShellNew verb for .sln is something other than loading a .sln (loading a .sln is done through VisualStudioLauncher).
Back to the .sln file: this one is different for any version of Visual Studio. Historically, the basic format is the same though (and I think this – in combination with VisualStudioLauncher – is the main reason it is not XML).
An empty solution file looks like this (note the empty line at the beginning), as described in Hack the Project and Solution Files:
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 11 Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
The accompanying .reg file like this:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.sln\ShellNew] "FileName"="Visual Studio Solution - VS11.sln"
When you look at the Format Version inside the .sln version, you see that it (12) is one bigger than the internal Visual Studio Version (11).
That is because Microsoft stepped up the internal version from Visual Studio .NET (2002) and Visual Studio 2003 from 7.0 to 7.1, but the solution file format version from 7.00 to 8.00 as the table below shows.
Note that the .NET 1.x versions of Visual Studio (2002 for .NET 1.0, 2003 for .NET 1.1) don’t have the GlobalSection/HideSolutionNode/EndGlobalSection part and the # Visual Studio xx line.
With a little bit of querying, I got at this table:
| Visual Studio version | Internal version | Solution file format version |
|---|---|---|
| Visual Studio .NET (2002) | 7.0 | Microsoft Visual Studio Solution File, Format Version 7.00 |
| Visual Studio 2003 | 7.1 | Microsoft Visual Studio Solution File, Format Version 8.00 |
| Visual Studio 2005 | 8.0 | Microsoft Visual Studio Solution File, Format Version 9.00 |
| Visual Studio 2008 | 9.0 | Microsoft Visual Studio Solution File, Format Version 10.00 |
| Visual Studio 2010 | 10.0 | Microsoft Visual Studio Solution File, Format Version 11.00 |
| Visual Studio 2012 (a.k.a. VS11) | 11.0 | Microsoft Visual Studio Solution File, Format Version 12.00 |
All files to get you going are in Change set 89386 on BeSharp.CodePlex.com.
It was a bit hard to get all those version numbers, so here are the sources I used:
–jeroen
Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Internet, link rot, Power User, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, WWW - the World Wide Web of information | Leave a Comment »