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