Friday, March 30, 2012

create a new Iteration for a Project in TFS

at Team > Team Project Settings > Areas and Iterations

search for "ODBC" at the start menu in Windows 7 to bring up the ODBC Data Source Administrator

Create a data source to a MSSQL database out in the world at the "System DSN" tab.

in a call to DatabaseName..TableName the .. syntax is either skipping the schema name or the owner name

.. stands in in lieu of .dbo. for example

get an ALTER statement for an existing view

In MSSQL Server Management Studio one may right-click on a Stored Procedure or Function and select "Modify" to get an ALTER SQL statement for adjusting the item. You may also get an ALTER statement for a view by right-clicking on the view and then selecting: Script View as > ALTER To > New Query Editor Window

Safari on an iPhone will display the first 320 horizontal pixels of a background image

I made this image (a .gif of 750x1000 dimensions) and used it as a background at a web site.

 
 

I noticed that when I held my iPhone vertically that I seemed to see the first 320 horizontal pixels of a background image enlarged twice over covering 620 pixels of horizontal space. I emailed myself a screen grab. It is a .png of 640x960 dimensions.

 
 

When I resized the image in Photoshop to 320x480 (half the size), I get an active area of roughly 320x356 pixels which corresponds to the upper left 320x356 pixels of my background image. I laid the image below over the original background in Photoshop, positioning it at the upper left with the thin black line at the top and the menu stuff above it off the top of the layer. The image matched up to what was beneath it on the original background.

 
 

Turning my iPhone horizontally, I get what turned into a 960x640 pixels-in-dimension .png when I sent myself a screen grab.

 
 

When I reduced the image to a 320x213 size (one third original size), I got an active area of roughly 320x139 pixels which again corresponded to the upper left of my original background.

permissions errors when reaching out to other databases and servers from within a stored procedure

Be wary of reaching out to other servers or databases within stored procedures. Yesterday I tried to alter a stored procedure and in doing so I got a permissions error telling me I couldn't. I tried to troubleshoot. If you'll imagine that the stored proc was made up of ten hunks of code then I progressively tried removing one after another until I was able to make the alteration. I then tried to add anew the blob of code that was troublesome and found that I could not as it called a table on another server and I merely did not have rights to see the table in question. I had to ask a coworker to fix what I broke.

Thursday, March 29, 2012

use prefixes in MSSQL to denote databases, servers, and linked servers

Suppose you have a stored procedure on a server named Foo and you wished to get the count of a field out a table called Bar somewhere in the stored procedure. You might approach it like so:

SELECT @bar_variable = COUNT (bar_column) FROM dbo.Bar

 
 

What if you wanted to reach a different table called Bar that was in a database called Baz even though the stored procedure resided in a database called Foo? Well, you might approach it like this:

SELECT @bar_variable = COUNT (bar_column) FROM Baz.dbo.Bar

 
 

Moreover, you could do something like this:

SELECT @bar_variable = COUNT (bar_column) FROM Qux.Baz.dbo.Bar

 
 

In this example, Qux could be the name of another server, or Qux could be a "linked server" which is a variable defined at the server at hand (Foo) denoting a server named something else to correspond to the moniker of Qux.

Windows Authentication Web.config

<add key="ConnectionString" value="server=thatserverwehavetoconnecttoonportforty,40;Database=Foo;Trusted_Connection=Yes;"/>

Wednesday, March 28, 2012

one may only have up to 500 projects in an install of TFS!

...less in the case of some process templates

how to open two Excel sheets side by side

  1. open one sheet after another in Excel
  2. at the "View" tab in Excel select "View Side by Side"
  3. turn Synchronous Scrolling off (its toggle is by "View Side by Side")

to access Subversion

Download TortoiseSVN

a much better way to do longtail link routing in ASP.MVC (disregard my other post from last night)

The first thing that went through my head this morning was how stupid and embarrassing this post is. A better way to skin the cat I was trying to skin, without any .htaccess nonsense, is to have two routes like this:

public static void RegisterRoutes(RouteCollection routes)
{
   routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
   
   routes.MapRoute(
      "longtaillinks", "{id}",
      new { controller = "Home", action = "Longtail", id = UrlParameter.Optional },
      new { id = @"([A-Za-z0-9-]+).html" });
   
   routes.MapRoute(
      "Default",
      "{controller}/{action}/{id}",
      new { controller = "Home", action = "Index", id = UrlParameter.Optional }
   );
}

 
 

That which does not fall over to the default route would routed by the first route to the Longtail action which could start off like this:

public ActionResult Longtail(string id)
{
   string[] longtailSegments = id.Replace(".html", "").Split("-".ToCharArray());
   
more code to follow...

 
 

This works! http://www.example.com/foo-bar-baz.html gets consumed as I expected and longtailSegments ends up with three strings containing "foo","bar", and "baz." Further into the Longtail action, logic for what to do with the segments could be offered or called from a different method.

Tuesday, March 27, 2012

routing within longtail links is the stuff of .htaccess but not ASP.NET MVC unfortunately

Have you ever wished you could open the Global.asax.cs file in an ASP.NET MVC application and replace this...

routes.MapRoute(
   "Default",
   "{controller}/{action}/{id}",
   new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

 
 

With this...

routes.MapRoute(
   "Default",
   "{controller}-{action}-{id}",
   new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

 
 

Your answer is: "No, why would I?" isn't it? I have a hunch that you don't see any reason to use hyphens in lieu of slashes as I suspect few do. I base my suspicion on the fact that four versions into ASP.NET MVC this sort of customization still isn't supported. Consider this URL however:

http://www.example.com/Sunglasses-Inventory-Rayban.html

 
 

Imagine running this URL with the second of the routing rules above. We would navigate to the Inventory action within the Sunglasses controller and pass "Rayban.html" as the id. The ".html" part of the id could be truncated away later. This sort of implementation would empower longtail (or long tail) SEO links. A more sophisticated set of routing rules would allow for even more content specific stuff to be concatenated with hyphens. Yay! This would work really well for SEO!

...and yet, this is not the way ASP.NET MVC works. What are the alternatives? How could we make this work?

ISAPI Rewrite allows one to run the .htaccess configuration files one associates with Apache on IIS. An .htaccess file will allow one to rewrite an inbound request of:

http://www.example.com/foo-bar-baz.html

 
 

To:

http://www.example.com/foo/bar/baz/

 
 

I've seen this stuff in action before working at framesdirect.com. http://www.blogstorm.co.uk/htaccess-mod_rewrite-ultimate-guide/ has the best bad example I've found in Googling tonight. It shows www.yoursite.com/product/123 rewritten to www.yoursite.com/product.php?id=123 with the following rule. Perhaps you can imagine how this rule could be written the other way around.

RewriteEngine on
RewriteRule ^product/([^/\.]+)/?$ product.php?id=$1 [L]

I found a way around the MVC4 Web.config content-blocking problem

http://stackoverflow.com/questions/6279643/prevent-iis-from-serving-static-files-through-asp-net-pipeline has a pretty good cheat sheet how to get around the problem I detail here. The two steps are:

  1. Download and run this update for IIS 7.0 and IIS 7.5: http://support.microsoft.com/kb/980368
  2. Replace true with false in this line of the Web.config file:
    <modules runAllManagedModulesForAllRequests="true">

 
 

This allowed me to get an MVC4 application working without content being blocked. The master page stuff still doesn't want to work for me, but I think that is a different MVC4 problem

How do I prep Visual Studio for TFS?

http://www.microsoft.com/download/en/details.aspx?id=329 is where one may download Team Explorer 2010 which will put the Team Foundation Stuff in the Visual Studio 2010 menu system.

Monday, March 26, 2012

Web.config barring me from seeing images, stylesheets, and .js files

It seems that the trend is to have Web.config bar a user from just navigating to any random bit of content. The default MVC4 application runs great in Cassini, but on IIS at my Rackspace server, I cannot "see" the images in the Images folder, the stylesheet in the Content folder, or, I'm guessing, the .js files in the Scripts folder. I have not confirmed the third failing, but it would fit with the first two. How do I open up permissions to see this content? Beats me. I'll keep trying to find a solution. I have had little luck in Googling so far, but then MVC4 is also in Beta.

This is not a bug. This is a trend. Orchard CMS does the same thing. It only lets you "see" what is in the Media folder. It does not allow you to put images just anywhere. If you make an Images folder and stick a bunch of images in it, you're going to be frustrated. The Media folder has its own Web.config file which seems to allow for an exception to blocking everything. It looks like so:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <appSettings>
      <add key="webpages:Enabled" value="false" />
   </appSettings>
   <system.web>
      <httpHandlers>
         <add path="*" verb="*" type="System.Web.StaticFileHandler" />
      </httpHandlers>
   </system.web>
   <system.webServer>
      <handlers accessPolicy="Script,Read">
         <add name="StaticFile" path="*" verb="*" modules="StaticFileModule"
               preCondition="integratedMode" resourceType="File" requireAccess="Read" />
      </handlers>
   </system.webServer>
</configuration>

 
 

I tried to make a Web.config file like this in the Content folder of my MVC4 app. This "solution" did not work. Grrr. I'll keep trying and update this blog when I know more.

The Web.config stuff has always seemed like magic to me.

I suppose I could just hack around the problem by hosting anything with a .css, .gif, .jpg, .js, or .png extension at a subdomain.

MOSS is Microsoft Office Sharepoint Server

cool

Sunday, March 25, 2012

make an animated .gif from an .mp4 video clip

Animated .gif files are back. I'm fascinated! The following two links touch on how you can covert a bit of a movie into an animated .gif cleanly:

 
 

I started trolling about Tumblr this weekend and I was impressed with what I found. I’m surprised at how smooth and clean the video-to-GIF stuff looks.

What are the SOLID Principals?

  1. The Single Responsibility Principle suggests that a class should have one reason to change. This does not mean that a class should have one method with just a few lines of code. It means that the class should correspond to one concept such as Person or Street Address. Assuming that a class has a good name in keeping with ubiquitous language, then a class that holds Manager in its name or is similarly named something vague with a name bridging several concerns is in violation of the Single Responsibility Principal. It is alright to have an "And" in a name occasionally, such as an object named "Street Address And Landline Phone Number." The two concepts need to fit together to justify an "And." (This description comes from Anne Epstein.) The name-based auditing for sanity checking if a class is in violation of the Single Responsibility Principle is only going to work if classes are named explicitly which is a must.

     
     
  2. Update on 8/17/2012: This description is terrible! Instead see this and this and this. The Open/Closed Principle suggests that one should "close-off methods" on a class (by making them private) that do not need to be exposed beyond the class such as internal calculations of properties that occur when one changes a getsetter. Methods which are public invite being used by other classes so methods which are public should only be so intentionally. Some requests need to go in a "front door" and be accessed within the class itself, beyond the eyes of the rest of an application. Don't reveal too much.

     
     
  3. The Liskov Substitution Principle (named for a Barbara Liskov) suggests one should not inherit from a parent if doing so requires significant polymorphism (overriding) for as much is a code smell. A square should not inherit from a rectangle as a parent. A square may be a rectangle "in real life" but it is not a rectangle as shaped in classes. Making a square inherit from a rectangle parent class would be an example of a violation of the Liskov Substitution Principle. A rectangle will have separate getsetters for both width and height, but such does not make sense for a square which cannot have differing lengths for width and height. (This example comes from Justin Pope.) A square that inherits from a rectangle would have to override the width and height getsetters to make a change to one enact a change to the other and would "smell."

     
     
  4. The Interface Segregation Principle suggests that it is better to have numerous interfaces that correspond to the numerous classes they empower in lieu of one or two large interfaces. Also, an interface should only expose the methods needed on a class, not every method it can.

     
     
  5. The Dependency Inversion Principle suggests that developers should loosely couple dependencies to classes, handing them in, in lieu of having classes call for them.

     
     
  6. The Law of Demeter is sometimes included as a sixth SOLLID principle while in other lists of SOLID Principals it does not appear. It suggests that classes should only have knowledge of other classes which are closely related. It is often best logically to have two classes speak through an intermediary rather than to make a direct association as a proliferation of direct associations without regard to boundaries creates a spaghetti mess of crisscrossing dependencies which will ultimately make an application unmanageable.

What is Inversion of Control?

Inversion of Control allows a project within a solution to access code in a different project from which the first project does not inherit. What is more, the second project may in fact inherit from the first project. StructureMap, Spring.NET, and Ninject! empower IoC and are what is known as IoC containers. There are two varieties of Inversion of Control: Service Locator and Dependency Injection. In Dependency Injection an XML file will denote how a project may find an otherwise inaccessible class for an interface against the flow of inheritance. With Service Locator, there is no such mapping. Instead the application context is crawled by the compiler to find an applicable match, based on naming convention, for a would-be dependency that is called outside of the scope of the current project and the project(s) it inherits from.

everything you stick in localStorage ends up as a string

You will thus need to cast integers back into integer form like so:

foo = parseInt(localStorage["bar"]);

 
 

Also, if you need to store a complicated object, this suggests that you stringify JSON to shove the object(s) in and then parse the string back to JSON when retrieving like so:

var testObject = { 'one': 1, 'two': 2, 'three': 3 };
localStorage.setItem('testObject', JSON.stringify(testObject));
var retrievedObject = localStorage.getItem('testObject');
console.log('retrievedObject: ', JSON.parse(retrievedObject));

check to see if something exists in HTML5 localStorage

I'm trying to understand interfacing with HTML5 localStorage. This seems like a pretty good guide. I did not however see a way within the post, at a glance, to gauge whether or not something exists already in localStorage, so I went fishing for and found this post which suggests checking with the triple equals operator like so:

if (localStorage.getItem("foo") === null) {

Saturday, March 24, 2012

Web SQL Database and SQLite

A Web SQL Database is recommended for building mobile applications even though the W3C views it as depreciated. There is not yet a good replacement.

Perhaps in conflict to what I just said: I think SQLite is another low weight database alternative for the mobile space too.

DbEncrypt

...was a tool that provided encryption for MSSQL2000 databases.

Thursday, March 22, 2012

NTAuth

NTAuth seems to be a way to do Active Directory validations.

DevExpress CodeRush is apparently a tool like JetBrains ReSharper

http://jesseliberty.com/2010/05/28/code-rush-vs-resharper/

column alias prefix-with-anything bug in MSSQL 2000

I began researching what could go wrong with a MSSQL2000 to MSSQL2008 migration today. I think it is mostly going to be weird fringe stuff. This posting suggests that you may prefix any column alias in MSSQL2000 without error which is a bug that was not "supported" in the later MSSQL versions.

SELECT name as gulla
FROM sysobjects
ORDER BY kulla.gulla

 
 

I wonder what other pain points we will hit...

pull the contents out of an .iso

...without actually burning a DVD. http://www.magiciso.com/ is a good tool for as much.

interesting thread on alternatives to $(document).ready

http://forum.jquery.com/topic/jquery-mobile-equivalent-of-document-ready

Wednesday, March 21, 2012

jQuery mobile events

Events in jQuery Mobile are:

  1. tap
  2. taphold
  3. swipe
  4. swipeleft
  5. swiperight
  6. orientationchange
  7. scrollstart
  8. scrollstop
  9. pagebeforeshow
  10. pagebeforehide
  11. pageshow
  12. pagehide
  13. pagebeforecreate
  14. pagecreate
  15. vmouseover
  16. vmousedown
  17. vmousemove
  18. vmouseup
  19. vclick
  20. vmousecancel

 
 

One may bind to these events as one would to any other. And by bind, I mean this stuff:

  1. $('#foo').bind('click', function() {
       alert($(this).text());
    });
  2. $('#bar').live('click', function() {
       alert($(this).text());
    });
  3. $("table").delegate("td", "hover", function(){
       $(this).toggleClass("hover");
    });
  4. bind effects immediate entities
  5. live effects those that may appear later too
  6. it seems delegate takes three parameters
  7. delegate is a marginally more performant version of live
  8. delegate must be declared before the thing it effects comes into memory (I think)

 
 

Binding to pageCreate() or pageInit() like this may be wise...

$('#foo').live('pagecreate', function(event) {
   alert($(this).text());
});

 
 

...as this yells:

Important: Use pageCreate(), not $(document).ready()

Microsoft Dynamics

Microsoft Dynamics seems to be Microsoft's SalesForce.com. I got a free trial this morning.

It was pretty easy to add an Account at the Accounts link seen at the left nav of the main interface and to add a Contact at the Contacts link found in the same place. To associate a contact I made with an account I made, I went to Accounts, opened the account I had created, clicked in the Contacts subsection within the account CRUD screen to make the top nav have contract-related controls, and then used the "Add Existing Contact" button to make the association.

ASP.NET MVC model binding on exposition in a super simple example

Here is a really straightforward example of model binding. Let's suppose we have a model that looks like this:

using System;
namespace MyApp.Models
{
   public class Person
   {
      public string Name { get; set; }
      public DateTime BirthDate { get; set; }
      public string BirthPlace { get; set; }
      public int NumberOfCats { get; set; }
   }
}

 
 

Our model exists in a copy of the default ASP.NET MVC3 app in which we expand HomeController to have a third action called PersonOverview like so:

using System;
using System.Web.Mvc;
using MyApp.Models;
namespace MyApp.Controllers
{
   public class HomeController : Controller
   {
      public ActionResult Index()
      {
         ViewBag.Message = "Welcome to ASP.NET MVC!";
         return View();
      }
   
      public ActionResult About()
      {
         return View();
      }
   
      public ActionResult PersonOverview()
      {
         Person azadeh = new Person();
         azadeh.Name = "Azadeh";
         azadeh.BirthDate = new DateTime(1977,1,1);
         azadeh.BirthPlace = "Iran";
         azadeh.NumberOfCats = 0;
         return View(azadeh);
      }
   }
}

 
 

return View(azadeh); above will attempt to bind the azadeh object to the view that is returned so that the view may easily use it. Here is the view, prepped to receive a Person object:

@model MyApp.Models.Person
<h2>Person Overview</h2>
<table>
   <tr>
      <td>@Html.LabelFor(model => model.Name)</td>
      <td>@Model.Name</td>
   </tr>
   <tr>
      <td>@Html.LabelFor(model => model.BirthDate)</td>
      <td>@Model.BirthDate.ToString("dd MMM yyyy")</td>
   </tr>
   <tr>
      <td>@Html.LabelFor(model => model.BirthPlace)</td>
      <td>@Model.BirthPlace</td>
   </tr>
   <tr>
      <td>@Html.LabelFor(model => model.NumberOfCats)</td>
      <td>@Model.NumberOfCats</td>
   </tr>
</table>

 
 

When we run our app (and then navigate to /Home/PersonOverview/) we get this:

Alright, let's spruce up our app some. Let's refactor our controller to be like so:

using System;
using System.Web.Mvc;
using MyApp.Models;
namespace MyApp.Controllers
{
   public class HomeController : Controller
   {
      public ActionResult Index()
      {
         ViewBag.Message = "Welcome to ASP.NET MVC!";
         return View();
      }
   
      public ActionResult About()
      {
         return View();
      }
   
      public ActionResult PersonOverview()
      {
         Person azadeh = new Person();
         azadeh.Name = "Azadeh";
         azadeh.BirthDate = new DateTime(1977,1,1);
         azadeh.BirthPlace = "Iran";
         azadeh.NumberOfCats = 0;
         return View(azadeh);
      }
   
      [HttpPost]
      public ActionResult PersonOverview(Person person)
      {
         
//set a breakpoint here to see what is in person
         return View(person);
      }
   }
}

 
 

Let's refactor our model to be like so:

@model MyApp.Models.Person
<h2>Person Overview</h2>
<form method="POST" action="/Home/PersonOverview/">
   <table>
      <tr>
         <td>@Html.LabelFor(model => model.Name)</td>
         <td>@Html.EditorFor(model => model.Name)</td>
      </tr>
      <tr>
         <td>@Html.LabelFor(model => model.BirthDate)</td>
         <td>@Html.EditorFor(model => model.BirthDate)</td>
      </tr>
      <tr>
         <td>@Html.LabelFor(model => model.BirthPlace)</td>
         <td>@Html.EditorFor(model => model.BirthPlace)</td>
      </tr>
      <tr>
         <td>@Html.LabelFor(model => model.NumberOfCats)</td>
         <td>@Html.EditorFor(model => model.NumberOfCats)</td>
      </tr>
   </table>
   <input type="submit" value="submit" />
</form>

 
 

When we run our app (and then navigate to /Home/PersonOverview/) we get what we see below. We now have a form that may post to itself, making changes to its content. If we set a breakpoint in the last of the four actions in our controller, we will hit the breakpoint upon first reposting the page. When one does so, one may then mouse over "person" in the method signature and inspect its properties. This object should have properties fully populated by the fields of the form in our view. This is another example of model binding.

Tuesday, March 20, 2012

virtual and override go together in C#

This offers: "In the C# language, the virtual keyword designates a method that can be overridden in derived classes."

callback example

What follows is from this training.

$(function () {
   $('#showAttendees').click(function () {
      var url = '@Url.Action("Show", "Attendee", new { confname = Model.Name })';
      var button = $(this);
      var callback = function (data, textStatus) {
         $('#attendees').html(data);
         button.hide();
      };
      $.get(url, null, callback, 'html');
   });
});

 
 

Remember Tom, this is called a callback and NOT a postback. Duh.

wiki of me

    "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis
  1. Reactive Manifesto
  2. preface
  3. Roslyn, CoreCLR, and RyuJIT
  4. pushState API and webhooks
  5. Hashbang versus HTML5 History API
  6. MBTI and FFM
  7. Typings
  8. canned Visual Studio Angular projects
  9. update UI templates in Visual Studio
  10. Resources versus Dependencies in .NET
  11. Program.cs varies between version 1 and version 2 of .NET Core
  12. app.UseStaticFiles();
  13. pulling things out of appsettings.json in an ASP.NET Core application
  14. the npm folder under the Dependencies folder
  15. Pentagonal Donut
  16. tsconfig.json
  17. webpack.config.js change to empower AoT compilation
  18. a webpack.config.vendor.js correction too
  19. keep manual changes to webpack.config.js and webpack.config.vendor.js
  20. deleting the dist folder and the default Error action
  21. what's in the ClientApp folder?
  22. boot.browser.ts and boot.server.ts
  23. turn off the caching of static files
  24. ViewModel
  25. attributes for ViewModels
  26. make a controller
  27. call one action returning JSON from another at a .NET Core MVC controller!
  28. old web forms ways to do routing
  29. convention-based routing versus attribute-based routing in MVC
  30. [NotNull] attribute
  31. the RESTful way in MVC... with an attribute
  32. preprocessor directives
  33. NMock3
  34. BASE_URL
  35. use HttpClient in a canned Visual Studio Angular 5 application
  36. style classes specific to the elements they sit at
  37. double asterisk for a wildcard in routing
  38. target properties
  39. use the class attribute as an Input???
  40. lifecycle hooks for directives
  41. other names for the banana box
  42. PathLocationStrategy vs. HashLocationStrategy
  43. Azure Table Storage
  44. loop in Entity Framework!
  45. the 3 ways to approach Entity Framework
  46. the very specific name ApplicationUser
  47. parent/child Code First Entity Framework relationships
  48. DbContext
  49. database management patterns/database initializers/DbInitializers
  50. connection strings
  51. loop in a connection string at Startup.cs
  52. the first migration
  53. dotnet update
  54. Guid versus numeric ids in Code First EF Core
  55. EntityEntry
  56. loop in a database seeder at Startup.cs
  57. Mapster
  58. IActionResult
  59. contravariance
  60. two differences between Observables and Promises
  61. Superclass and Subclass in Java
  62. treat the snapshot URL off of an ActivatedRoute instance as an array
  63. comments in LESS
  64. LESS options switches
  65. Switch CSS and LESS Compiler
  66. Bootstrap rivals!
  67. float: none;
  68. SIL Open Fonts License
  69. the four Web Components standards
  70. Foundation and Pure
  71. Template-Driven forms
  72. FormBuilder
  73. errors hanging off a FormControl
  74. do a .get off of a FormGroup to fish out a FormControl
  75. min and max numeric ranges of reactive forms validators
  76. "strictNullChecks": true
  77. JsonPipe
  78. IdentityDbContext
  79. AspNetSynchronizationContext versus SynchronizationContext
  80. non-null assertion operator
  81. RFC
  82. OpenIddict
  83. casting Guids to strings with a conditional magic argument
  84. PLATFORM_ID
    Angular 2 and up and TypeScript as well
  1. the template tag versus ng-container
  2. hidden form fields are really, really hidden
  3. TypeScript "dictionaries"
  4. sorting collections
    jQuery/JavaScript
  1. .keypress
  2. pressing space bar to select a radio button is same as clicking it
  3. Modernizr
  4. @Html.ValidationMessageFor and jquery.validate.js
  5. What browser am I using?
  6. event binding
  7. how to use a callback
  8. create an array and use .push to append to it
  9. a hash is an object, not an array, and must be created as such
  10. parse JSON to make a hash
  11. serialize objects to get them across the seam between C# and jQuery
  12. get a C# collection into jQuery and then use .each
  13. getting the current url, replacing every dash with a slash, and jQuery animations
  14. ===
  15. !!
  16. append to the html inside of a div with jQuery
  17. long polling example (timeout and setTimeout)
  18. progressively animate
  19. progressively load records with AJAX!
  20. keep form from posting
  21. real-time updates
  22. What is in JSON?
  23. compare the current date to another date
  24. iFrame interactions
  25. width
  26. make a button click from jQuery
  27. manipulate drop downs
  28. manipulate tables and dates
  29. use a variable in tandem with a magic string when manipulating an element
  30. functions and regex
  31. replace a substring
  32. split
  33. make sure a function is called when a drop down list changes
  34. find the nth-numbered element in a swath of HTML with jQuery
  35. remove part of a string via substring
  36. date stuff
  37. chaining variables
  38. using Plain-Jane JavaScript to get the values of form fields
  39. using Plain-Jane JavaScript to change styles
  40. going places
  41. interface with AJAX JSON from ASP.NET web forms applications
  42. draw on a Canvas
  43. checkboxes
  44. subtract one array from another in JavaScript
  45. use regular expressions in JavaScript
  46. slice (copy all or part of an array)
  47. try/catch, case, and casting to int
  48. see if a string contains a substring
  49. live/bind/delegate and innerHTML!
  50. animate, get current url, replace all slashes with dashes
  51. manipulate Date (remove days and find day of week)
  52. error handling
  53. $("#div").html("foo"));
  54. inheritance
  55. get width (and height) of browser and use it to change up the viewport metatag
  56. .call and .apply
  57. this
  58. debugger
  59. mocha 101
  60. script tags, adding to dropdowns with plain jane JavaScript, and underscore.js
  61. setInterval
  62. pop
  63. dropping $(document).ready
  64. pageinit
  65. throw away all of the contents of a dropdown list
  66. get the length of a dropdown
  67. get the selected value from a dropdown
  68. cast the value of a date type HTML control to a date
  69. loop through an array in JavaScript
  70. timer
  71. manipulate styles as an attribute
  72. find child nodes from a given DOM node
  73. drop something out of an array
  74. drop something out of an object
  75. grab from an object by position like an array
  76. make a reference-free copy of an object
  77. check if an object has properties
  78. stringify JSON
  79. enums
  80. return
  81. parse stringified JSON to an array
  82. drill deep into children from a parent
  83. setTimeout versus setInterval and how to pass variables to their functions
  84. cherry pick which children to manipulate
  85. grab an element by attribute such as style
  86. rounding
  87. scope strict mode
  88. encapsulation, inheritance, methods, and "classes"
  89. iFrame crosstalk between domains
  90. what is in the URL line?
  91. async: false
  92. .ajax error
  93. .trim()
  94. window.location.hostname and why it is weak
  95. react at the change of a dropdown menu
  96. early exit for foreach loops?
  97. double ampersand operator
  98. double pipe symbol operator
  99. question mark operator
  100. typeof
  101. instanceof
  102. .concat
  103. declare multiple variables in JavaScript on the same line
  104. charAt for finding the nth character in a string
  105. unbind
  106. the better way to .replace
  107. the simple read from an iFrame and disabling a button too
  108. find a string in an array of strings
    C# String Manipulations
  1. make sure a decimal is presented with the correct length in terms of digits
  2. put spaces before capital letters in a string
  3. encryption, title case, and substring stuff
  4. make an order number at least six digits
  5. date stuff
    Active Directory
  1. NTAuth
  2. Active Directory SIDs
  3. find your Active Directory username with System.Security.Principal
  4. get domains from forest
  5. find a user in a domain
    Config Files
  1. read from App.Config in a C# unit test project
  2. prevent MVC4 from blocking images
  3. SQL Server Express Local Connection String
  4. Windows Authentication Web.config Connection
  5. a normal connection string
  6. use connectionStrings from Web.config
  7. use appSettings from app.config
    MSSQL
  1. TRIM
  2. read lines from a flat file
  3. cast a substring to a datetime
  4. sending email!
  5. the JOIN in a view
  6. TOP
  7. select all columns from one table within a SQL join
  8. output parameters
  9. make guids auto-populate in SQL
  10. using SQL for sums and averages
  11. the "pagination" query
  12. TRUNCATE
  13. find a lack of matches with a JOIN statement
  14. cursor looping
  15. attach variables to a returned table as columns
  16. DISTINCT
  17. temp table
  18. classic CASE statement
  19. HAVING
  20. SQL transactions
  21. COUNT
  22. NOT IN
  23. foreign key
  24. Anshu Jain's SQL puzzle
  25. get above aggregate average values in MSSQL
  26. an example of a correlated subquery
  27. functions
  28. triggers
  29. CTE is MSSQL
  30. BETWEEN
  31. comments
  32. PRINT, CAST, and @@ROWCOUNT
  33. string manipulations
  34. NOT IN (1,13)
  35. decimal(p,s)
  36. IF
  37. DECLARE
  38. feed an INSERT from a SELECT in MSSQL
  39. UNION
  40. What stored procedures touch a given table?
  41. make a column in a SELECT from more than one selected column
  42. sort by ascending yet put the null values last
  43. use CHARINDEX to try to find a substring within a string
  44. smalldatetime
  45. get back the auto-incrementing id
  46. CAST varchar to int
  47. try to get around transaction locking
  48. add days to a date
  49. jobs
  50. REPLACE
  51. ISNULL
  52. grant execute rights to a user
  53. insert into numeric primary key column
  54. exec sp_helpdb
  55. date format friendly to both MSSQL and Oracle
  56. multiple columns in a cursor and CTEs when not abusing MIN
  57. an UPDATE with a JOIN in SQL
  58. jamming a CASE statement into a WHERE clause
  59. Generic_Table_Type
  60. use EXEC and EXECUTE to call sprocs
  61. types of joins
  62. safety check for if a sproc is yet made
  63. add/drop a column
  64. table variables
  65. GETDATE()
  66. BREAK out of CURSOR looping
  67. RAISERROR
  68. add a column to a table and make it NOT NULL
  69. cast a record count to a variable
  70. UNIQUE
  71. drop a table
  72. rename a table
  73. update numerous rows at once
  74. drop a constraint
  75. bridge table with foreign keys and auto-incrementing id
  76. rename a column
  77. add a NOT NULL column to an existing table that has rows in it
  78. allow a column to have null values
  79. make inbound parameters optional at a stored procedure
  80. nolock
  81. SCOPE_IDENTITY() and @@IDENTITY
  82. try/catch
  83. select directly to temp tables and table variables
  84. stuff
  85. sp_addlinkedserver, linked servers, and USE
  86. drop a stored procedure
  87. put a specific number into an auto-incrementing id
  88. FLOAT vs. REAL
  89. COLLATE for a culture and CHAR vs. NCHAR vs. VARCHAR vs. NVARCHAR
  90. check to see if a varchar column is NULL or an empty string
  91. iif
  92. STRING_SPLIT
    NuGet
  1. what is NuGet?
  2. determine where to install and where to install from
  3. install a specific version
  4. uninstall (the right way)
    C# 4.0 in a Nutshell
  1. Encapsulation in contrast to the Open/closed Principal
  2. M magic for decimal creation
  3. default values for value types in an array
  4. bottleneck through parent
  5. virtual and override
  6. casting a child class to a parent interface
  7. delegate example
  8. Func example
  9. use Action instead of Func when you wish for a Func to return nothing
  10. multicast delegate example
  11. closures
  12. = () =>
  13. events
  14. Math.Pow
  15. Put methods in a class that require casting to an interface to use!
  16. how getsetters reflect
  17. user interface technologies
  18. DateTimeOffset
  19. using IFormatProvider and ICustomFormatter
  20. using string.Format with flags enums
  21. set the culture of the current thread
  22. Tuples
  23. Process
  24. predicates
  25. Array.ConvertAll shows off the power of delegates
  26. type-changing across .Select
  27. lazy execution of IEnumerable
  28. expression trees
  29. query from one IEnumerable type collection to another
  30. .AsEnumerable()
  31. .AsQueryable()
  32. Upcast to an Interface!
  33. Cross Join Queries and Non-equi Join Queries
  34. expressions in C#
  35. Skip and Take
  36. Join/Distinct/Union/Structs/lookups
  37. Intersect/Union/Except
  38. SelectMany
  39. let
  40. LINQ to XML
  41. XML, XPath, and XSD
  42. XSLT
  43. IDisposable
  44. using
  45. Code Contracts
  46. Contravariance
  47. where T : Whatever
  48. File I/O
  49. Networking Cheat Sheet
  50. remoting
  51. the GAC has priority over the bin
  52. instance method
  53. the parameterless constructor on a base class is always called
  54. attributes
  55. use dynamic to add nonspecific types in C# 4.0
  56. use dynamic to cherry pick more specific types
  57. visitor pattern
  58. dynamic method calls
  59. static state
  60. unmanaged code and the C# extern keyword
  61. #if(!DEBUG)
  62. encrypt and decrypt
  63. signature versus public key handshake
  64. finalizers
  65. threading
  66. write your own equality comparisons
  67. spinning
  68. why use PLINQ?
  69. why not use PLINQ?
  70. asynchronous methods
  71. MarshalByRefObject
  72. unsafe
  73. fixed
  74. handing in delegates to APIs
  75. COM
  76. regular expressions
  77. conclusion
  78. What's in the Appendix?
  79. waiting for BOTH threads to finish before going forward
  80. generics magic
  81. the carat operator
    SharePoint 2010
  1. delete a page and then get it back
  2. rename a menu link
  3. create a list from an Excel sheet
  4. export a list back to Excel
  5. make list columns sortable
  6. add a column to a list
  7. four ways to work in SharePoint
  8. User field type
  9. of "Navigation"
  10. getting started
  11. Hive
  12. Elements.xml
  13. make a list instance in a 2010 SharePoint project
  14. .wsp in the debug folder
  15. Navigation versus Quick Launch
  16. lookups
  17. using the canned site columns
  18. SharePoint 2010 runs in ASP.NET 3.5
  19. VMs for SharePoint
  20. Site URL
  21. Central Administration
  22. add a subsite
  23. extend permissions to others
  24. fields and rules in InfoPath
  25. SharePoint alerts
  26. get your InfoPath work back into Visual Studio
  27. using jQuery with SharePoint
  28. dealing with FOUCs
  29. change form field controls with jQuery
  30. jQuery validation against User type fields in SharePoint
  31. pain point when manipulating select lists from jQuery
  32. grant permissions
  33. add a folder
  34. add a page and add it to the navigation
  35. edit a page
    Razor
  1. ActionLink
  2. ActionLink polymorphism
  3. RenderPartial
  4. if logic
  5. Html.IdFor
  6. make a dropdown from an enum
  7. Html.RenderPartial in Razor
  8. form fields
  9. make a form that explicitly uses POST
  10. Partial versus RenderPartial
  11. ModelState.IsValid
  12. model binding
  13. RenderSection
  14. BundleConfig.cs and Styles.Render/Scripts.Render
  15. Layout = null
  16. file type TextBoxFor
  17. @Html.Hidden
  18. @Html.ValidationMessageFor
  19. @ after @
  20. make your own controls
  21. select an item in a dropdown list
  22. the pig operator and a multi-select dropdown based on an enum
  23. Styles.Render versus Scripts.Render
  24. Html.Raw
  25. double up the at symbol
  26. get the url path to an action
  27. get the name of the current controller or action
  28. comments
  29. using ViewBag with Html.BeginForm requires some casting
  30. DisplayName attribute used with Html.LabelFor
  31. put an id on a Razor form
  32. Html.HiddenFor values
  33. AJAX forms
    Mongo
  1. ABCs of Mongo
  2. CRUD
  3. add something then fish for it
  4. mess with Mongo in a shell
  5. C# driver for Mongo
  6. db.things.remove({});
  7. db["entities"].find(); and db["entities"].remove();
  8. getting started with C# integration
  9. get a filtered collection
  10. search with multiple criteria
    IIS
  1. remember to create a user
  2. update an IIS6-friendly Web.config to be IIS7-friendly
  3. ~ support
  4. MVC4 content-blocking problem
  5. hosts file
  6. application pools
  7. open IIS web sites in Visual Studio
  8. install IIS
  9. use IIS in Visual Studio
  10. fake security
  11. set up IIS8 Express in Windows 8
  12. nest an ASP.NET web site within an ASP.NET web site
  13. Method Not Allowed
  14. turn off caching
  15. virtual directories
    CSS
  1. transitions
  2. LoVe and HAte
  3. clear: both;
  4. white-space: nowrap;
  5. get rid of Safari form field highlighting
  6. use css3 selectors to differentiate styles for different input types
  7. center a div horizontally
  8. em
  9. the HTML tags for CSS
  10. @font-face
  11. media queries
  12. z-index
  13. end scrolling
  14. max-width
  15. emasculation of HTML tables
  16. get rid of bullets at unordered lists
  17. make text align to the bottom of a div
  18. put a scrollbar on a div
  19. absolute positioning
  20. fixed positioning
  21. sticky positioning
  22. static positioning
  23. nth-child
  24. leading underscores and asterisks
  25. CSS footer!
  26. nesting
  27. points to em to pixels to percentage
  28. letter-spacing/word-spacing
  29. shrink-wrap a div around its copy
  30. dropdown menus
  31. content, before and after
  32. calc!
  33. box-shadow
  34. gradients
  35. the new cellspacing="0"
  36. text-shadow
  37. accordion
  38. transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  39. make the background-color nothing
  40. the ~ and the + and the > too
  41. background-size: cover; ...and circular avatars
  42. word-wrap: break-word;
  43. table cell formatting inline no longer
  44. prevent cascading?
    VB Script
  1. this "VB Script" section is misnamed
  2. CType and DirectCast
  3. read from a text file
  4. try/catch/finally
  5. static-style stuff
  6. difference with C# in use of backslashes
    Command Line Commands
  1. net stop w3svc
  2. ipconfig /flushdns
  3. installutil C:\LocaleOfPublishedFiles\NameOfApplication.exe
  4. shutdown /r /t 10
  5. gpresult /V
    WinForms
  1. make a password field
  2. find the current directory
  3. Application.Restart();
    this & OBJECT PROTOTYPES
  1. bolt properties onto a function
  2. bindings for this
  3. Array.prototype.slice.call()
  4. constructors
  5. currying with bind
  6. the spread operator and passing dummy objects for this
  7. fat arrow
  8. simple and complex primitives
  9. Object.assign
  10. Object.defineProperty
  11. .hasOwnProperty
  12. pseudopolymorphism
  13. how to name classes
  14. put a method on a function in JavaScript?
  15. __proto__
  16. OLOO
  17. duck typing
  18. class, constructor, super, extends
  19. conclusion