Monday, September 17, 2012

IIS Self-Signed Certificate for SharePoint 2007 Site

See sites such as this one. Basically create the web app in CA setting port to 443 and SSL. Create the Site coll. Then in IIS 7, select the site, click Bindings, then add a self signed certificate.

Friday, September 14, 2012

Thursday, September 6, 2012

Binding Mode Redundant for ItemsSource

Was wondering whether I need to set binding mode on DataGrid columns. The answer is no:

there is no need for this to be TwoWay. ItemsSource bindings work by reference, so when Add/Delete/Edit takes place on an editable datagrid, the chages reflect back to the source observable collection automatically (inspite of the binding mode).
WPF-it http://stackoverflow.com/questions/7505487/refresh-datagrid-automatically-when-its-itemssource-changed

Saturday, September 1, 2012

Event Forwarder

Example of event forwarder in ICommand implementations see ref1  ref2 in BCL and in RelayCommand:


public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}

Sunday, August 26, 2012

Move IE scrollbar to left side

When reading article can be useful to put the scrollbar on the left, e.g. if following along with instructions, etc.

paste the following in the address bar; if "javascript:" disappears, retype it:

javascript:void(document.dir="RTL");

ref: http://www.codingforums.com/showthread.php?t=1048

Wednesday, August 22, 2012

Modules Window Symbols Loading

To force the symbols to load, open up the Modules view (Debugger -> Windows -> Modules), navigate to the DLL containing the method, right click and load symbols. 
JaredPar -http://stackoverflow.com/questions/4649093/visual-studio-2010-debugger-steps-over-methods-and-doesnt-stop-at-breakpoints

Thursday, August 2, 2012

Adding Global Site Collection Administrator

The users set in the following location will not appear in the Site Collection Administrators Site Settings > Permissions.

Central Administration > Application Management > Policy for Web Application

Sunday, July 29, 2012

Searching/Querying in .NET

- Delegates are good for defining a generic criteria parameter of search method -- no need to hard code criteria in loop of each of multiple search methods (see also Specifications)
- Lambdas obviate need to define named delegate implementations (or methods matching a generic .NET delgate type i.e. Predicate or Func)
- Expression trees to construct lambdas on the fly, allowing construction of criteria at run time

Visual Studio Shortcut keys

Ctl-A-K-F - lines code up

Saturday, July 28, 2012

WPAS

- Feature of IIS 7
- Can host HTTP & Non-HTTP services

Thursday, July 26, 2012

WCF Channel

The Channel is the combination of Data Contract (e.g. ISomething), binding (e.g. HTTP), and endpoint (e.g. URI). It can be used in place of the autogenerated proxy by means of the channel factory.

Sunday, July 22, 2012

Control Invoke

Control calls without Invoke (with delegate) from other thread sometimes works but throws exception in Visual Studio

For example modifying the example from http://msdn.microsoft.com/en-US/library/a1hetckb(v=vs.80) to read
expand collapse
public void Run()

        {

            myFormControl1.myListBox.Items.Add("test from thread");

...
works in non-debug mode:

Full Code: expand collapse

Wednesday, July 18, 2012

Tuesday, July 17, 2012

POX and WCF Data Services

POX and WCF Data Services implies REST, i.e. access resources via URL (http://weburl/service.svc/Products   retrieves list of products in XML) from which can readily write LINQ queries.

Assign Delegates to Predicates

e.g. Filter property of an ICollectionView is a predicate, so pass it a delegate which is applied to each item (returning true or false based on some criteria)

Spline (Animations)

XAML key frames and spline curves

Pivot Rows to Columns in SQL Server

Pivot row values to columns by using this pattern in SQL Server

SELECT @strValues = COALESCE(@strValues+',', '') + FirstName
FROM
( SELECT DISTINCT FirstName FROM [AdventureWorksLT2008R2].[SalesLT].[Customer]) X
ORDER BY FirstName

SELECT [Result]= @strValues

ref: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53885

Sunday, July 15, 2012

The RAII Idiom

The essence of the RAII idiom is that the class file encapsulates the management of any finite resource, like the FILE* file handle. It guarantees that the resource will properly be disposed of at function exit. Furthermore, file instances guarantee that a valid log file is available (by throwing an exception if the file could not be opened).

http://en.wikibooks.org/wiki/C%2B%2B_Programming/RAII

Wednesday, July 11, 2012

A+ Notes

CNR - riser slot supports plug and play, supercedes AMR
WUXGA - supports 1080p
Unplug AC adapters when not in use (their transformer draws constant current)
Full Duplex - no need for collision detection
DDR - 184-pin (one notch), DDR2 and DDR3 - 240-pin
Inverter - supplies power to LCD backlight
ATX 6-pin connector - supplies 75 W at 12V
TOSLINK - fiber connector for digital audio
EVDO card - cellular PC communication
AM2+ - Phenom socket
Mini-PCI - formerly used in laptops
CardBus - version of PCMCIA
ExpressCard - replaced PCMCIA/CardBus
Line tester - test telephone jacks
Boot logging - safe mode option, records driver loading
D-subminiature - D shaped connector, e.g. DB-25, DE-9
Fan placing - top/rear for exhaust, front/sides, intake ref
SIMMs - go in pairs, DIMMs can be single
BNC connector - for thinnet (coaxial)
FTTx -  last mile fiber optic specs
DirectAccess - VPN-like IPv6 solution
wbadmin - backup command for Vista

Tuesday, July 10, 2012

Fiber connectors

MT-RJ - looks like RJ-45
ST - long straight tip
SC - plastic plug
LC - resemble small SC

IPv6

Link-local: FE80:://10

Site-local: FEC0::/10

 Global: 001...

ULA: FC00::/7

Lookback: 0:0:0:0:0:0:0:1 or ::1

802.11 AP

802.11 standard describes the AP which bridges the wireless LAN to the wired LAN.

In Vista, enter the SSID into Network name: prompt of the "Manually connect to a wireless network" screen.

Saturday, June 30, 2012

Control Properties

"class level variables"
"backing field"

From AppDev demo "Control Properties" in "Custom Controls" ASP.NET module

Tuesday, May 29, 2012

Mixin vs. Inheritance

Abstract classes have been criticized not being examples of specialization -- allegedly the purpose of OO inheritance -- but rather of extension.

Well, to redeem the value of the abstract class, we simply call it a "mixin" and all is good and valid.


Mixins are synonymous with abstract base classes. Inheriting from a mixin is not a form of specialization but is rather a means of collecting functionality. A class or object may "inherit" most or all of its functionality from one or more mixins, therefore mixins can be thought of as a mechanism of multiple inheritance.
 http://en.wikipedia.org/wiki/Mixin

Sunday, May 20, 2012

In Memory Storage - Use static keyword

Use the static keyword in a controller class level field (e.g. a List<string>) for IMDB (in-memory database)

Wednesday, May 2, 2012

Fluent Interface

A fluent interface is normally implemented by using method chaining to relay the instruction context of a subsequent call (but a fluent interface entails more than just method chaining
 http://en.wikipedia.org/wiki/Fluent_interface

Thursday, April 26, 2012

Sunday, April 15, 2012

Optimistic/Pessimistic Concurrency

The technique that first investigates whether other transactions have changed values in a row before permitting changes to be submitted.

Contrast with pessimistic concurrency control, which locks the record to avoid concurrency conflicts.

Optimistic control is so termed because it considers the chances of one transaction interfering with another to be unlikely.

http://msdn.microsoft.com/en-us/library/bb399373(v=vs.110).aspx

Saturday, April 7, 2012

HTML 5 and User Agents

User agents are not allowed to infer any meaning from the value of the id attribute

http://web.archive.org/web/20110716100719/http://diveintohtml5.org/semantics.html
Hence, the usefulness of semantic elements, such as "<header>," over pre-HTML 5 '<div id="header">'

Sunday, April 1, 2012

jQuery Templates Binding Expressions

Example:     <li><b>${Name}</b> (${ReleaseYear}) ${addCommas(GrossProfit)}</li>
http://api.jquery.com/tmpl/ 

Uses the $.tmpl method as a utility function of the jQuery function.

Templates can be defined in script elements or passed to the tmpl method.

Features one-binding only.

Tuesday, March 27, 2012

jQuery Ajax call to .NET web service

Service must be decorated with System.Web.Script.Services.ScriptService attribute. $.ajax client side method may have contentType property set to "application/json; charset=utf-8" and dataType property set to "json." Then iterate through response objects with response.d.

COM: Pointers to Interfaces Required

A client must have an interface pointer to invoke methods in that interface.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms687230(v=vs.85).aspx

Saturday, March 10, 2012

Math Symbols

see http://mathforum.org/library/drmath/view/51433.html
for upside down A ("for all"), epsilon, etc.

Tuesday, February 28, 2012

jQuery Cached Objects

When performing an action repeatedly on a jquery wrapper object (i.e. "wrapped set"), cache the object by assigning it to a variable.


Saturday, February 18, 2012

UML - Association versus Aggregation versus Composition

The good article at http://aviadezra.blogspot.com/2009/05/uml-association-aggregation-composition.html (found when trying to remember the meaning of UML association notations in http://en.wikipedia.org/wiki/File:Domain_model.png) discusses these, indicating the unique features of each:

Aggregation - denotes non-exclusivity.

Association - includes "weak" associations

Composition - denotes dependency (exclusivity)

There's a fourth, association that was not mentioned: Dependency (denoted by dashed arrow), which denotes weak association. Therefore, as far as I can tell, composition associations, in general, can be represented by either of Aggregation, Dependency, or Composition UML notation.

So, where is association notation useful? Many-to-many relationships and mutually navigable relationships.