Friday, November 30, 2012

doctor an .sln to add a project

It is pretty easy to splice a reference to another project into a solution by opening the .sln file in notepad and adding something like these two lines before the word "Global."

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectName",
   "ProjectName\ProjectName.csproj", "{2A55F118-6989-431B-B9DE-02C11001B1B4}"
EndProject

Fortify Repository

HP Fortify has its own online repository for its reports that interfaces with Visual Studio while remaining independent of Team Foundation Server. There will be an "HP Fortify Remediation" menu within Visual Studio 2010 is you have the HP Fortify plugin installed which will allow you to connect to the Fortify-specific staging grounds for reports. In the "HP Fortify" menu there will be options for both running reports and pushing them up to the repository. The "pushed up" reports then become options in the "HP Fortify" menu itself. I'm assuming that they are there for everyone who accesses the repository. I'm not positive yet as I am working alone today.

Thursday, November 29, 2012

Ektron Searching

A search in Ektron is intially against everything, and EVERYTHING is then filtered down based on business logic. For example, if you are not permissioned to see X in everything then X will be filtered away.

the HP Fortify plugin for Visual Studio 2010 is really easy to use

You will end up with an "HP Fortify" menu in Visual Studio and...

  1. Analyze Source Code of Solution in the menu will crawl your source code and display results in an "Analysis Results" pane.
  2. Generate Report ... will let you make a PDF of what is in the "Analysis Results" pane.

This has proved much easier to use than the standalone tools which we found did not want to crawl C#, and indeed perhaps they could not measure C# gremlins without access to the compiler.

if you really need to mess with some source code short-term and locally when TFS won't let you

...then copy the folder holding the source code to another locale on your laptop and then reopen the newly copied solution. This will sidestep Team Foundation Server telling you that you cannot edit anything.

cannot alter a file in Team Foundataion Server

This suggests you must explicitly check out in TFS to get around this error that occurs upon attempting an edit:

The command you are attempting cannot be completed because the file 'WHATEVER' that must be modified cannot be changed. If the file is under source control, you may want to check it out; if the file is read-only on disk, you may want to change its attributes.

Wednesday, November 28, 2012

keep your Windows 7 PC from falling asleep while you copy stuff from a file share after leaving for the day

  1. go to the Control Panel
  2. change "View by: Category" to "View by: Small icons"
  3. go to "Power Options"
  4. Change the plan settings for the radio button that is checked
  5. the radio button checked is likely "Balanced (recommended)

One may create a new .fpr directly within HP Fortify's Audit Workbench.

Click on "Advanced Scan..." and then select a folder to scan. Finally step through the wizard you are given.

Ektron may now run in C# 4.0

Cool.

make an HP Fortify PDF Report that gives a comprehensive breakdown of flagged problems

At the "Generate Report..." dialog in Audit Workbench, change "Report:" from "Fortify Security Report" to "Fortify Developer Workbook"

I may have found the right place to get rules for HP Fortify

It is in the Options... submenu under the Options menu in Audit Workbench. That said, I could not get it to work when I tried.

make a PDF in Audit Workbench

At: Tools > Generate Report...

I was able to make a PDF from an .fpr in HP Fortify's Audit Workbench.

HP Fortify Scan Wizard must have rules files

C:\Program Files (x86)\Fortify Software\HP Fortify v3.50\Core\config\rules ...is where they live. The Scan Wizard will not run without this, but with this, it should make a .fpr file that you may open in HP Fortify Audit Workbench. I copied the rules files from someone else's PC. I don't know how to get them otherwise.

How to select C# as a language in HP Fortify's Scan Wizard

At the "Show Languages in Source Tree" piece of the wizard, check the checkbox for "Visual Studio" and then just uncheck it. The wizard will ultimately make a .bak file you may run to generate a PDF report of your code's health issues.

HP Fortify decided to uninstall itself somehow overnight

...so I went to:

Control Panel > Uninstall a program > right-click on HP Fortify v3.50 > Change ...which fired off a process that repaired Fortify. I then had to newly add the license file back at:

C:\Program Files (x86)\Fortify Software\HP Fortify v3.50\fortify.license

Ektron handles markup in a case-sensitive manner.

<p>Hello world.</P> will cause an explosion. Do not expect the awful gunk exported from Microsoft Word or Eloqua to not need your cleanup before incoporation.

Team Foundation Server "cannot be migrated because the solution cannot be checked out" error

I solved this TFS problem:

Solution file 'whatever' cannot be migrated because the solution cannot be checked out from source code control. To migrate the solution, make sure the solution file can be checked out and re-open it.

By just unchecking the checkbox for read-only inspite of what these two links told me:

  1. http://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed
  2. http://social.msdn.microsoft.com/Forums/en-US/tfsversioncontrol/thread/88d652fa-1fef-4e3c-8dcb-a2079a96f031 (suggested I uncheck "Allow editing of read-only files; warn when attempt to save" at Tools > Options... > Enviroment > Documents)

upsert and merge

I heard the term upsert today and it is synonymous with merge per Wikipedia which is never wrong.

MERGE INTO TABLE_NAME USING table_reference ON (condition)
   WHEN MATCHED THEN
   UPDATE SET column1 = value1 [, column2 = value2 ...]
   WHEN NOT MATCHED THEN
   INSERT (column1 [, column2 ...]) VALUES (value1 [, value2 ...

Addendum 1/16/2015: This is really stupid. Please see this instead.

folder options and unhiding extensions and show hidden files

Type "folder options" at the start menu at Windows 7 and then go to the "View" tab of the "Folder Options" dialog box which appears to do things like unhide file extensions and show hidden folders. Yawn. (I do this everytime in a new environment.)

How to select C# as a language in HP Fortify's Scan Wizard

At the "Show Languages in Source Tree" piece of the wizard, check the checkbox for "Visual Studio" and then just uncheck it. The wizard will ultimately make a .bak file you may run to generate a PDF report of your code's health issues.

Share photos on twitter with Twitpic

Tuesday, November 27, 2012

SCSI expansion

SCSI (Small Computer System Interface) allows one to bolt on more "space" to a server. You can't do this with NAS.

 
 

Addendum 6/21/2016: NAS is Network Attached Storage. It's any ability to share storage at a server beyond the bounds of the server.

 
 

Addendum 9/11/2017: SCSI is pronouced... "skuzzy"

Beyond Compare

One of my coworkers mentioned Beyond Compare as a code comparison tool today. It should be more comprehensive than WinMerge which is just for finding the inconsistencies in two dissimilar files.

extend your desktop in Windows 7

at: Control Panel > Appearance and Personalization > Adjust screen resolution

Duh.

Telerik JustCode

...is a rival to JetBrains ReSharper per a coworker. See: http://www.telerik.com/products/justcode.aspx

SSDT is the new BIDS

This has links to get SSDT (SQL Server Data Tools) for VS2010 and VS2012 and SSDT is the "new BIDS" (so I hear).

Set local IPs for DNS Servers in Windows 7

  1. right click on the "bars" icon on the start bar by the clocks and pick "Open Network and Sharing Center"
  2. click the "Local Area connection" link
  3. in the "Local Area Connection Status" dialog box click the "Properties" button
  4. uncheck "Internet Protocol Version 6 (TCP/IPv6)"
  5. select "Internet Protocol Version 4 (TCP/IPv4)"
  6. click the "Properties" button
  7. click the radio button for "Use the following DNS server addresses:"
  8. type in the addresses
  9. at a command prompt type: ipconfig /flushdns

One may run HP Fortify from the inside or from the outside looking in.

It will support both external and internal scans.

Boomi, CastIron, and Jaspersoft are alternatives to SSIS

So I hear.

SonicWALL

...is a company now owned by Dell. They offer a VPN solution.

DBAmp

DBAmp offers translation between SalesForce and MSSQL. It allows you to run SQL commands such a SELECT * against SalesForce! You may also, as you might imagine, push records in.

Gomez

Gomez is some manner of performance testing for web sites. It will tell you how speed a roundtrip to the server and back takes for a POST, GET, etc.

Monday, November 26, 2012

someone found my blog Googling "draw on canvas using WatiN"

I think you'll want to draw on a canvas with PhantomJS instead. I have heard PhantomJS lets you run JavaScript/jQuery at the browser you "test." I write this having never used PhantomJS. :)

one has to have the Enterprise level of Ektron to use eSync which allows for local development copies of the MSSQL database

I arrived in Nashua, New Hampshire today for a few weeks of business travel. I will be working with Ektron while I am here, and as fate would have it, Ektron itself is located in Nashua. I could not resist stopping by to see what I might gleam. Thanks to Derek Barka for taking the time to meet with me!

Share photos on twitter with Twitpic

I'll start work tomorrow. It is rather hard to know what to expect from the outside looking in and without having had the opportunity to work with Ektron before. We flirted with using Ektron at FramesDirect for a shopping cart package, but ultimately FramesDirect went with Magento. Derek said that http://developer.ektron.com/ is a good place to go with questions. Ektron is also very good about responding to Twitter-based queries. They have been very proactive about engaging with me once I started blogging of Ektron. The receptionist at Ektron gave me some canned marketing materials and together with the Wrox book I bought, this comprises all of the print reading materials I could find.

Share photos on twitter with Twitpic

Alright, I know this blog posting has been mostly fluff. The thing I want to say is: Ektron has three engagement levels:

  • Enterprise
  • Professional
  • Standard
Share photos on twitter with Twitpic

...and one has to have the Enterprise level to use eSync which allows for local development copies of the MSSQL database. I don't think that will exist where I am going. This is my hunch, based on what I've heard. I'll know more tomorrow on the other side of the ocean of the unknown.

Share photos on twitter with Twitpic

Friday, November 23, 2012

Ektron ABCs

The Workarea for a default CMS400Min install of Ektron will allow users to administer the folder structure, menu system, content, metadata, and users themselves. There are three types of users:

  1. Membership users who can only use the proper portion of the site
  2. Content Authors who may use the Workarea (a backend system for editing the frontend system)
  3. four canned accounts that fall outside of the other two definitions
    1. Admin, a global administrator
    2. Builtin, which may change the license key if everyone else is locked out
    3. InternalAdmin, which holds global great permissions for programmatic tinkering (forgive me for not putting it more eloquently)
    4. Vs, which is used for talking to Ektron Framework Server Controls via Visual Studio across web services

The passwords for Admin, Builtin, and Vs need to be changed from their defaults before a push to production. There is a group called Everyone that all users start out as a part of and a group called Administrators that users may be added to. Becoming a member of Administrators does what you might expect. The Settings section of the Workarea will allow one to create users:

Share photos on twitter with Twitpic

Thursday, November 22, 2012

I am beginning a book on Ektron.

I am beginning to read a Wrox book called "Ektron Developers Guide" in advance of diving into an existing Ektron project on Tuesday. I wish there was a way to download a trial copy of the software, but unfortunately, all I can do in advance of Tuesday is flip through the one book (from 2011) that seems to have been written on the proprietary CMS. The software is not trivial. It has a significant footprint, expanding into many things. Beyond being a CMS, it offers a canned shopping cart too.

Share photos on twitter with Twitpic

Ektron started in 1998 as what the book calls a WCMS (web content management system) and at the time must have been something other than web forms ASP.NET. It is today of framework 3.5 web forms ASP.NET, with an heavy emphasis on breaking chunks of screen real estate up into .ascx (User Control) widgets. The widgets may be "Ektron Widgets" which one builds using something called PageBuilder. These developers may build out themselves and get creative with. There are also over eighty canned ".NET Server Controls" which are for things that Ektron's own realize arise as common wants. Both varieties of widget take into account whether or not a user has permissions to see the widget, edit the widget right there in the page, etc., so there is likely a robust way to administer privileges for various varieties of users within Ektron. (I assume that is coming later in the book.) Ektron's stuff is a hodgepodge of home-rolled and not home-rolled. They defer to a bigger player in a given space when it makes sense. For analytics for example, one may use Google or Omniture. An API uses the following namespaces:

  1. Ektron.CMS is the oldest namespace and the book seems to admit that it could be better.
  2. Ektron.CMS.API is newer and allows one to do bulk data processing in code that is not easy elsewhere.
  3. Ektron.CMS.Framework is the newest and is apparently slowly being expanded in scope to offer a better alternative to what one may find in Ektron.CMS which is piecemeal and not intuitive. The book suggests that once you're used to this namespace that things will be easy to find using IntelliSense and some guessing. One thing leads to another.
  • System.Web.UI.UserControl will be used by a widget (an .ascx).

 
 

A surprising upfront chunk of the book is on Agile versus Waterfall and what the roles should be on an Ektron team. The book asserts that the better part of your team can just be persons who manage content and not actual developers. This is, after all, the whole reason to have a CMS. The book suggests that one should build a "CMS implementation guide" and that there is a sample project called "OnTrek" to be had that shows off how Ektron may be done with many widgets in use.

 
 

When you set up Ektron, a wizard will walk you through the process and put folders in the right places. Some content is kept in an MSSQL database while other content exists as "assets" which I am guessing to be images and text/XML files. Even if all developers use a common database like a communal bowl, there is the problem of keeping copies of assets synchronized across all independent development environments.

Share photos on twitter with Twitpic

Ektron has a feature called "Load Balancing" for this sort of synchronization concern and it also has a feature called "eSync" which allows each development environment to keep its own independent and standalone copy of the database without being so isolated that one cannot get the database updates another developer makes.

Share photos on twitter with Twitpic

eSync doles out the database updates to the otherwise isolated environments. Think of The Tarantino Project, as it is going to be something like that. It looks like there are attempts to address speed issues with complication too. The book suggests that pages will not "recompile relevant files" unless there is a change, although what I have read thus far of this is vague. There is a "Workarea" folder that takes forever to compile and cannot be set to be excluded from its project given Ektron's nature. One can hack around this pain point by making the folder hidden in Windows itself. There is a way to debug libraries without launching the debugger or running unit tests, but what I have read so far is also vague on how to do this.

Tuesday, November 20, 2012

ISNULL in MSSQL

This suggests this:

ISNULL ( check_expression , replacement_value )

 
 

...is how to handle a value being null. You could use it to replace something like this:

SELECT Foo, Bar, Baz FROM Qux

 
 

...with something like this:

SELECT Foo, ISNULL ( BAR , 42 ), Baz FROM Qux

Monday, November 19, 2012

REPLACE in MSSQL

REPLACE(P.PhoneNumber,'-','') as PhoneNumber

remove Price PEEP malware from Chrome

This offered the following steps (which worked) to help me get rind of the Price PEEP malware which also shows off how to manage plugins in Chrome:

  1. Click the link on the right that looks like a little gray box with 3 lines, "maybe looks like a little tablet".
  2. Click on Settings.
  3. At the bottom of the page click "Show Advanced Settings".
  4. On the far left - top of the page, click on "Extensions".
  5. You will see Peep extension....On the far right of the extension you will see a small, gray trashcan.
  6. Click on the trashcan.
  7. Click "yes remove peep".
Share photos on twitter with Twitpic

Sunday, November 18, 2012

Ektron and Fortify, from the outside looking in

Ektron

 
 

Fortify

  • HP Fortify Software Security Center suggests I may get a free trial of HP WebInspect Free Trial Request. The URL is http://www.hpenterprisesecurity.com/products/hp-fortify-software-security-center
  • I was told "Our corporate policy does not allow us to issue trials to generic email addresses such as Yahoo! or Gmail." when I completed the form using tomjaeschke@tomjaeschke.com.
  • This offers: "It uses HP Fortify’s award winning static analysis to provide the most far-reaching vulnerability detection in source code available today." ...making me wonder if it will crawl C# for issues.

Wednesday, November 14, 2012

Agile process documentation

I went to AgileAustin last night and watched a panel discussion on architecture. The discussion largely took a how-do-we-deal-with-the-fact-that-management-will-not-approve-a-rewrite theme, but more interesting (to me) was an early tangent on how an Agile process could produce documentation.

One of the participants in the audience asserted that there is a false perspective that an Agile process is a panacea and that in fact, yes, you still have to know what you are doing or you will just build a big ball of mud with Agility. The incremental process will let you realize that you're doing something wrong quickly, but nothing more. One of the panelists suggested that a sprint zero to set up some architecture could be a wise move.

In building a product, Geoff Meyer of Dell, suggested that one could go to the product owners for some example, initial use cases by asking about whom the competition is and what some things to potentially test could be. Get the owners involved in the details and get marketing claims out of process. The marketers should be able to see how they'll write promotional materials based upon what you are to bake in the first few sprints, so the marketers will be doing some work paralleling the developers. Herein some documentation may be driven by want for money instead of being sidestepped as a waste of time as might be the norm. I thought it was a good first step to deal with this problem.

As I sit here typing this up it seems like the marketers would also want to detail what differentiates their product from rivals, and that initial sprints would be of differentiation as much as of a generic foray into the space at hand.

Geoff Meyer is shown in the center of this photo and the panelist at his left (looking towards the camera) is Ryan Vanderwerf of ReachForce. The panelist at the left of the photo is David Sheth of Calavista.

Share photos on twitter with Twitpic

The event was moderated by Lee Fox.

Share photos on twitter with Twitpic

Tuesday, November 13, 2012

jobs

In looking at the Object Explorer in Microsoft SQL Server Management Studio, I see that below a server are six "folders" for:

  1. Databases
  2. Security
  3. Server Objects
  4. Replication
  5. Management
  6. SQL Server Agent

I spend all of my time in "Databases" but this suggests that SQL Server Agent is where the jobs are kept. ...And, in taking a look, it seems to be so. Right-clicking on a job and picking "Properties" reveals...

  1. General
  2. Steps
  3. Schedules
  4. Alerts
  5. Notifications
  6. Targets

General will have a checkbox for if the job is enabled while Steps will denote which sprocs are called and Notifications will tell you who is flagged by email when the job runs. Jobs are how one runs stored procedures on a timer (what might have been called a cron job in FreeBSD once upon a time). Windows Task Scheduler in contrast is used for running console apps written in ASP.NET on a timer.

add days to a date in MSSQL

DATEADD(D, 2, @DateToAddTwoDaysTwo) is an example of adding two days to a date in MSSQL. Negative values take you "back in time." http://msdn.microsoft.com/en-us/library/ms186819.aspx seems like a pretty good cheat sheet. It says:

  • y is of year
  • m is of month
  • d is of day
  • h is of hour
  • n is of minute
  • s is of second

SSIS is kinda ghetto.

Share photos on twitter with Twitpic

At Santanna we seem to have some very simply SSIS packages for ETLing flat files consumed from utilities. We:

  1. have an Execute SQL Task reach out to a stored procedure which ultimately calls a complicated select statement against a database table with columns holding a one-to-one dump of the flat file's data points
    • in the Properties pane in BIDS, the SqlStatementSource donotes something like EXEC sp_Whatever pointing out which stored procedure to call
  2. have a Script Task put the data from the select to MSSQL via VB with inline SQL statements
    • right-clicking on the task and selecting "Edit..." brings up a dialog box
    • from here click "Edit Script..." to see the actual script

Today Paul Herrera taunted me over Twitter with: "What's wrong with putting code in a place that you CANNOT write unit tests for? :P" when he saw me tweet of SSIS. Indeed SSIS is kinda ghetto.

recursion

Wikipedia says: "Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem. The approach can be applied to many types of problems, and is one of the central ideas of computer science." and this means you need to write an algorithm for your fix!

Ctrl-Alt-Delete will let you change your password in Windows 7!

Duh.

Paul Tidwell on Azure

Share photos on twitter with Twitpic

I saw Paul Tidwell (right) of Falafel speak on Azure at ADNUG last night. His code:

Share photos on twitter with Twitpic Share photos on twitter with Twitpic
Share photos on twitter with Twitpic Share photos on twitter with Twitpic

Stuff said:

  1. What was referred to as Metro applications are now "Windows 8 Store" applications.
  2. Azure media services offers encoding built with IIS Smooth Streaming, MP4, and conversion to Apple HTTP Live Streaming (HLS).
  3. One may get a 90-day free trial of the Azure services.
  4. Download and install the SDK. Version 1.6 of the SDK seemed a lot more stable to Paul than version 1.7 from which he had connectivity issues in Visual Studio.
  5. See http://msdn.microsoft.com/en-us/library/windowsazure/hh973618.aspx for how to use the API. The code given above is of this.
  6. One may injest video directly at Azure and store it there or, via Azure, provide a front end to a pipeline. Create a new media service in Azure like so:
    Share photos on twitter with Twitpic

Monday, November 12, 2012

Lync

I just participated in video conferencing for the first time in my life using Microsoft Lync. Fun stuff.

PhoneGap

http://phonegap.com/ seems to be some manner of tool for writing HTML5 apps friendly to numerous mobile platforms.

Sunday, November 11, 2012

Cold Fusion to die?

At Sharon's Polyglot event last week I spoke to a developer who has made a career in Cold Fusion and who is now attempting to crawl out of it into another language. He felt that Adobe was about to let Cold Fusion die as he said Adobe is to offshore its Cold Fusion development efforts.

sessionStorage core concepts

I just played with sessionStorage for the first time and it is easy:

  • set it: sessionStorage.setItem("session_id", value);
  • get it: var sid = sessionStorage.getItem("session_id");

 
 

sid above will be null if the code in the second bullet is run first before something like that of the first bullet. I confirmed that if you are able to populate "sid" and then you turn around and close and reopen the browser that sid will be null unless you repopulate it. Yay!

Saturday, November 10, 2012

singleton pattern

The singleton pattern ensures that an instance of a class is always a unique instance.

Addendum 5/6/2015: This old note is pretty confusing. Singleton conceptually means that no two instances of the thing will exist independently and therefore a singleton may act like a global variable.

openquery

This suggests that openquery queries reach out to linked servers. I don't really understand them as of this writing.

SELECT * FROM OPENQUERY (MyLinkedServer, 'SELECT * FROM MyDatabaseTable')

Thursday, November 8, 2012

how to name a project

I am at Sharon Cichelli's Polyglot Programmers of Austin and the most interesting thing to come up tonight is a suggestion for how to pick a name for a new project:

  1. Go to: http://en.wikipedia.org/wiki/Special:Random
  2. If you do not get a one word name, just return until you do.

old school JsonResult stuff

This suggests doing it like this:

public JsonResult GetCityList()
{
   var list = from city in repository.Cities.GetAll()
      select new { Text = city.Name, Value = city.ID };
   return Json(list.ToList());
}

 
 

I've done it like this before:

public ActionResult Whatever()
{
   return Json(new { greeting = "hello" }, JsonRequestBehavior.AllowGet);
}

 
 

JsonRequestBehavior is of the System.Web.Mvc namespace.

today's geek lunch

At today's geek lunch I learned:

  1. Node.js keeps dependencies as copies of the project holding the directory. This can mean multiple identical directories copied about.
  2. Compiler-as-a-service will let you keep C# in a database field that may be run when when summoned/queried into a project.
  3. EMR stands for Electronic Medical Record
  4. NLog was recommended to do logging. In order to log you still need to catch and exception in a try/catch. Try to be smart about how you write these instead of sprinkling them everywhere. (think CQRS)

still struggling with ResGen

I am still struggling with reading a .resources file to address this. I was able to make a welcome.resx and a welcome.de.resx into welcome.resources and welcome.de.resources (moving the English version to the "root" as my reading suggests a root is mandatory) with ResGen like so:

Share photos on twitter with Twitpic

Tuesday, November 6, 2012

resource generation

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\resgen.exe will contain a tool called ResGen which may be used to run command line commands to transform .resx files into .resources files if one downloads it here and I am convinced that I need to use it to make my .resx files here accessible by the code I wrote.

(go vote today)

Monday, November 5, 2012

struggling with resources

Share photos on twitter with Twitpic

Trying to follow an example in C# 4.0 in a Nutshell, I made welcome.en.resx as shown in the image. When inspected in notepad, the file ended like so:

   <data name="Greeting" xml:space="preserve">
      <value>hello</value>
   </data>
</root>

 
 

I also made welcome.de.resx for a German greeting.

   <data name="Greeting" xml:space="preserve">
      <value>hallo</value>
   </data>
</root>

 
 

The resources were in an MVC4 project. I tried to roll a test in a test project like so:

using System.Reflection;
using System.Resources;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace ResourcesExperiment.Tests
{
   [TestClass]
   public class MyTest
   {
      [TestMethod]
      public void TestMethod1()
      {
         Assembly assembly = Assembly.LoadFile(@"c:\Tom\ResourcesExperiment\
               ResourcesExperiment\bin\ResourcesExperiment.dll");
         ResourceManager resourceManager = new ResourceManager("welcome",
               assembly);
         System.Threading.Thread.CurrentThread.CurrentUICulture = new
               System.Globalization.CultureInfo("en");
         Assert.AreEqual(resourceManager.GetString("Greeting"),"hello");
      }
   }
}

 
 

This blew up like this:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "welcome.resources" was correctly embedded or linked into assembly "ResourcesExperiment" at compile time, or that all the satellite assemblies required are loadable and fully signed.

 
 

This and this had some advice, but I am yet to get around the problem. I tried putting the resources in a App_GlobalResources and/or App_LocalResources and I experimented with setting the Build Action to both Embedded Resource and Content. I also tried to just jam my logic into a Controller, setting a breakpoint at return View();

using System.Reflection;
using System.Resources;
using System.Web.Mvc;
namespace ResourcesExperiment.Controllers
{
   public class HomeController : Controller
   {
      public ActionResult Index()
      {
         ResourceManager resourceManager = new ResourceManager("welcome",
               Assembly.GetExecutingAssembly());
         string setBreakpointHere = resourceManager.GetString("Greeting");
         return View();
      }
   }
}

 
 

...and yet. I'm still screwing something up.

no parameters in test method signatures

If the TestMethod attribute decorates a method (assuming the Microsoft.VisualStudio.TestTools.UnitTesting namespace) one cannot have parameters in the method signature, otherwise the test will be reported at "Not Runnable" in the Test Results pane in Visual Studio.

Saturday, November 3, 2012

em

One em is equal to the current font size while two ems are equal to to twice the current font size. In Internet Explorer, at the Page menu, there is an option for Text size which allows one to pick options for Largest, Larger, Medium, Smaller, and Smallest. If the size of a font is not concretely defined like so:

font-size: 10px;

 
 

...then its size will change as you change this setting. (By the way, I don't know how to change this setting in other browsers as I don't care.) This allows people to set the fonts to be really big if the web page they are veiwing is accomodating. If you want to be accomodating, but also wish to bias the font-size even as it changes, you can do something like this:

font-size: 1.1em;

 
 

...which is going to make the font 10% larger than the default across all five of the settings found in the Text size option in the Page menu. The pixel value settings in contrast will maintain one fixed size across all five of the settings.

I have a few questions for the room on documentation.

I looked through the slides here from a talk Emmelyn Wang undertook (with a Mr. Christopher Ward) on how documentation certainly provides a return on a company's investment and is moreover crucial to the financial health of an enterprise. I wasn't actually at the talk when it was held in Oregon so of course I'm just getting the gist, but the gist is:

  • Documentation that has integrity, accessibility, and searchability is key. It serves as the go-to crutch for many processes and in its absence or weakness such processes will have dysfunction and businesses will suffer for it. Think of a call center's staff and how it does its job. Or, think of the scenes from "Love and Other Drugs" wherein Jake Gyllenhaal, as a Pfizer rep in training, tries to recite his talking points on Zoloft that he has to retain before a match at his fingertips burns him. Where does the information he needs to do his job come from?
  • Pilot programs in the name of understanding what a process is and how the parties involved fit into it are a good way to start building that documentation which your gut tells you are lacking.
  • Documentation is needed for presales.
  • Documentation is needed post sales. It will empower your helpdesk, allowing the helpdesk to be... helpful, and hence increase customer loyalty. The slide deck has metrics on how many customers leave companies due to bad customer service experiences and how more than half of the time they are leaving for a competitor. The average business looses half of its customers every five years, but the average business should also be trying to do something about this problem. Improving customer retention is a good money-making strategy. It can cost up to five times more to gain a new customer than to merely keep one from leaving. Empower your own to stem the bleeding!
  • Documentation is needed for contacts. A searchable CRM is a must have.
  • At the end of the slide deck there is some data on our modern problem of a talent drought in IT. The good news is that if you were to make a pie chart of all of the tech jobs that American companies can't fill that there is a sizable piece of pie which can be populated by data analysts which does not demand an ability to write code.

I am convinced that Emmelyn is right!

The bad news is that I see a geek culture that struggles with documentation. There is a trend in favor of logging errors and also having good commentary when checking into source control, but there is also a trend towards writing readable code in lieu of having code comments, and, in an Agile process, there isn't going to be the upfront documentation of the Waterfall process. The latter two "negatives" are arguably not negatives at all, but, with regards to Agile, retrospective notes are largely the only documentation. It doesn't make sense to type up copy on what your application does when that wasn't defined upfront and is subject to change as development is underway. You could argue that someone should roll documentation on an application when it is "finished," but this doesn't happen in my experience.

At Veterans Affairs, I was put in charge of retiring a server running MSSQL2000 databases in the name of a bigger push to get away from MSSQL2000. Some databases had not been used in forever and could be dropped. Others had to be migrated to MSSQL2008. Largely, the only way to figure out what was what and what application something corresponded to was to speak to various people in the building I was working in. Little was documented.

I then became part of the problem myself. I rolled a bunch of documentation, but when I realized that my whole job was of documentation and playing with Excel and Outlook all day long, I found another job and got out of there. Again, I see a geek culture that struggles with documentation.

What are some potential solutions? Hire the right ratio of business analysts to developers? What will the analysts do during an Agile process? I'd love to hear any feedback!

Fun Fact: Emmelyn Wang is the only human being ever to work at both Headspring and Dovetail.

Addendum: Since writing this blog posting I thought of the stories that drive an Agile process. I suppose at development's end a holistic view of an application could be put together from the stories themselves as the sum of the stories executed upon would add up to what an application does. I've never yet seen what happens at the "end" of an Agile project.

Friday, November 2, 2012

I hate the GAC

If a library is in the Global Assembly Cache it is, per C# 4.0 in a Nutshell, going to take precedence over the same library in your bin folder. Confusing! I didn't know this until yesterday, but I've always loathed the GAC because it sort of "hides" dependencies by empowering a false belief that you have everything you need at your app. At least it does for me or anyone else who does not consciously think of the GAC.

Thursday, November 1, 2012

div is depreciated in HTML5

...or is that deprecated? Whenever I'd use the term depreciated at HDRI someone would correct me and tell me to use deprecated. :)

Anthony Dominguez was telling me about this this morning and he asserted that one of the things mentioned in these presentations is that one should use a div to break stuff up as a last resort only. This idea is going to be a BIG change for me as div is my crutch for everything! Anthony said that the videos suggest using article and section instead of div. It looks like they both may have header tags inside of them and that at least section will accomodate a footer tag as well. Yikes. I remember how painful it was for me to stop crafting everything with Dreamweaver tables and go to a tableless design, embracing CSS. I'm in for another jarring change again.