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.