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
TFS Guidance
This P&P article provides guidance on structure of TFS project
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 beWPF-it http://stackoverflow.com/questions/7505487/refresh-datagrid-automatically-when-its-itemssource-changedTwoWay
.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).
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; }
}
Thursday, August 30, 2012
Shallow Copy
Example of "shallow copy", as well as OCP
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
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
JaredPar -http://stackoverflow.com/questions/4649093/visual-studio-2010-debugger-steps-over-methods-and-doesnt-stop-at-breakpoints
Tuesday, August 14, 2012
SharePoint 2007 Dev Tutorials
Workflow quickstart
Workflow with task quickstart note1
Change project to web app type
Web Part Create and Deploy
Debug a WSS webpart
note, if get errors make running with local admin or user with SeDebugPrivilege token.
Series of SharePoint workflow tutorials
Workflow with task quickstart note1
Change project to web app type
Web Part Create and Deploy
Debug a WSS webpart
note, if get errors make running with local admin or user with SeDebugPrivilege token.
Series of SharePoint workflow tutorials
Monday, August 6, 2012
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
Central Administration > Application Management > Policy for Web Application
Tuesday, July 31, 2012
Helpful Silverlight/WPF Tutorials
Article similar to Josh Smith's MSDN MVVM article for Silverlight.
binding to VM property (e.g. an ICommand) in DataGridTemplateColumn: ex. by Bill
On Message Broker architecture. Also how to use (Application.Current as App)
First SL3
L2S with WPF
http://www.c-sharpcorner.com/uploadfile/anavijai/integrating-silverlight-in-sharepoint-2010/
http://beyondrelational.com/modules/2/blogs/433/posts/12021/different-ways-to-bind-data-grid-in-silverlight.aspx
Consuming SharePoint Web Services from Silverlight see here for how to set endpoint address; here for sample crossdomain.xml and clientaccesspolicy.xml. To cast the result of the linq to bindable ObservableCollection see.
Adding Dynamic Columns. For fixing "XamlReader.Load() does not accept event handlers" error, see.
See bottom of this for Error handling. Sortable Dynamic Columns.
binding to VM property (e.g. an ICommand) in DataGridTemplateColumn: ex. by Bill
On Message Broker architecture. Also how to use (Application.Current as App)
First SL3
L2S with WPF
http://www.c-sharpcorner.com/uploadfile/anavijai/integrating-silverlight-in-sharepoint-2010/
http://beyondrelational.com/modules/2/blogs/433/posts/12021/different-ways-to-bind-data-grid-in-silverlight.aspx
Consuming SharePoint Web Services from Silverlight see here for how to set endpoint address; here for sample crossdomain.xml and clientaccesspolicy.xml. To cast the result of the linq to bindable ObservableCollection see.
Adding Dynamic Columns. For fixing "XamlReader.Load() does not accept event handlers" error, see.
See bottom of this for Error handling. Sortable Dynamic Columns.
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
- 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
Saturday, July 28, 2012
WPAS
- Feature of IIS 7
- Can host HTTP & Non-HTTP services
- 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
Full Code:
expand collapse
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:
namespace WindowsFormsApplication1 { public partial class MyFormControl : Form { public delegate void AddListItem(string myString); public AddListItem myDelegate; private Button myButton; private Thread myThread; public ListBox myListBox; private Button myNoThreadButton; public MyFormControl() { //InitializeComponent(); myButton = new Button(); myNoThreadButton = new Button(); myListBox = new ListBox(); myButton.Location = new Point(72, 160); myButton.Size = new Size(152, 32); myButton.TabIndex = 1; myButton.Text = "Add items in list box"; myButton.Click += new EventHandler(Button_Click); myNoThreadButton.Location = new Point(70, 190); myNoThreadButton.Size = new Size(100, 32); myNoThreadButton.Text = "Add items No thread created"; myNoThreadButton.Click += new EventHandler(ButtonNoThread_Click); myListBox.Location = new Point(48, 32); myListBox.Name = "myListBox"; myListBox.Size = new Size(200, 95); myListBox.TabIndex = 2; ClientSize = new Size(332, 333); Controls.AddRange(new Control[] { myListBox, myButton, myNoThreadButton }); Text = " 'Control_Invoke' example "; myDelegate = new AddListItem(AddListItemMethod); } static void Main() { MyFormControl myForm = new MyFormControl(); myForm.ShowDialog(); } public void AddListItemMethod(String myString) { myListBox.Items.Add(myString); } private void Button_Click(object sender, EventArgs e) { myThread = new Thread(new ThreadStart(ThreadFunction)); myThread.Start(); } private void ButtonNoThread_Click(object sender, EventArgs e) { for (int i = 1; i <= 5; i++) { string myString = "(no thread) Step number " + i.ToString() + " executed"; AddListItemMethod(myString); } } private void ThreadFunction() { MyThreadClass myThreadClassObject = new MyThreadClass(this); myThreadClassObject.Run(); } } public class MyThreadClass { MyFormControl myFormControl1; public MyThreadClass(MyFormControl myForm) { myFormControl1 = myForm; } String myString; public void Run() { myFormControl1.myListBox.Items.Add("test from thread"); for (int i = 1; i <= 5; i++) { myString = "Step number " + i.ToString() + " executed"; Thread.Sleep(400); // Execute the specified delegate on the thread that owns // 'myFormControl1' control's underlying window handle with // the specified list of arguments. myFormControl1.Invoke(myFormControl1.myDelegate, new Object[] { myString }); } } }
Friday, July 20, 2012
DataGridView Object DataSource Must Contain Properties
Not fields. Found this out the hard way. see http://www.codeproject.com/Articles/24656/A-Detailed-Data-Binding-Tutorial
Wednesday, July 18, 2012
Yield Return is Lazy
The method with it will not execute unless the results are used. See http://www.codeproject.com/Articles/38097/The-Mystery-Behind-Yield-Return
ForEach Extension Method
empList.ForEach(delegate(Employee e)
{
Console.WriteLine("{0,2} {1,7} {2,8} {3,8} {4,23} {5,3}", e.ID, e.FName, e.MName, e.LName, e.DOB, e.Sex);
});
http://www.codeproject.com/Articles/35667/How-to-Use-LINQ-GroupBy
Console.WriteLine("{0,2} {1,7} {2,8} {3,8} {4,23} {5,3}", e.ID, e.FName, e.MName, e.LName, e.DOB, e.Sex);
});
http://www.codeproject.com/Articles/35667/How-to-Use-LINQ-GroupBy
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)
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
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
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
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
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.
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
"backing field"
From AppDev demo "Control Properties" in "Custom Controls" ASP.NET module
Monday, June 11, 2012
Anonymous Method Rules
Don't declare a return type - it is inferred from the delegate signature.
http://www.codeproject.com/Articles/17575/Lambda-Expressions-and-Expression-Trees-An-Introdu
http://www.codeproject.com/Articles/17575/Lambda-Expressions-and-Expression-Trees-An-Introdu
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.
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 chaininghttp://en.wikipedia.org/wiki/Fluent_interface
Thursday, April 26, 2012
Extension Methods and Linq
Adding using System.Linq; directive to class file implements extension methods for arrays, lists, etc.
http://msdn.microsoft.com/en-us/library/bb383977(v=vs.90).aspx
http://msdn.microsoft.com/en-us/library/bb383977(v=vs.90).aspx
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.
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:
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.
More explanation on when to use arrows: http://awgquotes.blogspot.com/2012/02/uml-associations-objectmentor.html
Tuesday, February 7, 2012
Yield keyword
I learned about the C# Yield keyword at http://www.youtube.com/watch?v=F7L9seU_mak&feature=player_embedded
Also learned about IEnumerable at http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx
Motivation for IEnumerable to simplify looping.
Subscribe to:
Posts (Atom)