AWG Blogs

  • Getting ADB Working for SPH-M840 - Had a SPH-M840 Galaxy Ring Virgin Mobile 3G Android version 4.1.2, attempting to install apps from Android Studio failed to detect device. Installed SAMSUN...
    6 months ago
  • How to check if I have write permissions to an Oracle table - SELECT CASE WHEN COUNT(*) > 0 THEN 'YES' ELSE 'NO' END AS PERMISSIONS FROM ( SELECT privilege FROM ( select * from dba_tab_privs where (grantee = 'MY_USE...
    6 months ago
  • JSF vs Struts 2 - JSF was designed in part by the authors of Struts to create a "Struts" that did a more accurate implementation of MVC (Struts is technically "Model 2") a...
    7 months ago
  • XML Beans vs JAXB - Seems XML Beans is superior: JAXB provides support for the XML schema specification, but handles only a subset of it; XMLBeans supports all of it. Also, by...
    11 months ago
  • Algorithms and OOP - In addition to DCI, "generic programming" as well as the move to functional programming appears to add nuance to the OOP notion of joining behavior with da...
    1 year ago
  • Flyweight vs Singleton - Implementations seems to be virtually identical, differing only in style, where the flyweight object is created and held by associated objects (containers:...
    1 year ago
  • init-param vs context-param - see for background. Gist: context-param variables are global and accessible thro...
    1 year ago
  • rbenv vs RVM - RVM is responsible not only for changing Ruby versions, but for installing rubies and managing gemsets, as well. ...Along with rbenv [to manage ruby versi...
    1 year ago

Sunday, March 18, 2012

Force Post in .load method

The following code:
may produce the error in the Response as visible from the Console tab of Firebug: "Request format is unrecognized for URL unexpectedly ending in '/HelloWorld'."

This ASP.NET web service expects a POST. To force a POST change the code by adding a bogus object to the .load jQuery method:

Update: Actual fix is to edit the web.config, see comment by Lotas here.

Monday, March 12, 2012

Setting Theme in Feature Receiver

When provisioning web sites, the theme was not taking. To get it working I made the following change to RestoreWebProperties, which was generated by SharePoint Solution Generator.

string key = xWebProperty.Attributes["Key"].Value;
string value = xWebProperty.Attributes["Value"].Value;
//this does not work for __IncludeSubSitesInNavigation, use AllProperties instead
/* if (web.Properties.ContainsKey(key))
web.Properties[key] = value;
web.Properties.Add(key, value);
} */
//need explicit set, apparently setting via property bag does not effect update
if (key == "vti_themedefault")
catch { }

web.AllProperties[key] = value;


Note, get the theme key from TemplateID element in SPTHEMES.XML. Also do web.Update() instead of web.Properties.Update().

Friday, March 9, 2012

TFS Project Folders and Workspaces

In Source Control Explorer, one way to map separate folders to separate local paths, perhaps on a separate drive e.g., is to use Workspaces.

Do File, Source Control, Workspaces, Add Workspace. Name the Workspace as appropriate, e.g. "My Projects." Select the TFS project folder, and the corresponding Local folder. Click OK.

This way you can separate your local files on a separate local root folder, (e.g. c:\My Projects") from folders other team members own (e.g. mapping of c:\Other projects).