Wednesday, March 30, 2011

VMWare player: blank full screen on Windows 7

Solution: enable "Accelerate 3D graphics."

Friday, March 4, 2011

BitLocker: get out of recovery mode

Some changes to BIOS will cause bitlocker to enter recovery mode.

One way to get out of this follows:

- enter the 8 groups of 6 digits
- get into Windows
- type "manage-bde -protectors -disable c:" from a admin command prompt
- reboot
- type "manage-bde -protectors -enable c:" from a admin command prompt
- reboot

It shouldn't prompt now.

See here for details.

Thursday, March 3, 2011

SharePoint: list throttling messages

There are two messages that people often get when throttling limits (5K default) is reached.

"Displaying only the newest results below. To view all results, narrow your query by adding a filter.": this is seen when metadata navigation and filtering is enabled for the list.

"This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.": this is seen in all other cases.

Wednesday, February 9, 2011

SharePoint 2010: code for dumping a taxonomy tree

Just customize the data you need from each node type (store, group, set, term).
        private void DumpTaxonomy(string siteUrl)
{
Stack<string> stack = new Stack<string>();
using (SPSite site = new SPSite(siteUrl))
{
TaxonomySession session = new TaxonomySession(site, false);
int nts = 0;
foreach (TermStore ts in session.TermStores)
{
nts++;
int ng = 0;
foreach (Group g in ts.Groups)
{
ng++;
int ns = 0;
foreach (TermSet s in g.TermSets)
{
ns++;
int nt = 0;
foreach (Term t in s.Terms)
{
nt++;
DumpTerm(t, stack, 4);
}
stack.Push(ReportNode(3, nt));
}
stack.Push(ReportNode(2, ns));
}
stack.Push(ReportNode(1, ng));
}
stack.Push(ReportNode(0, nts));
}
while (stack.Count > 0)
{
Console.WriteLine(stack.Pop());
}
}

private void DumpTerm(Term t, Stack<string> stack, int level)
{
int nt = 0;
foreach (Term children in t.Terms)
{
nt++;
DumpTerm(children, stack, level + 1);
}
stack.Push(ReportNode(level, t.Name + " " + nt.ToString()));
}

private string ReportNode(int level, object children)
{
StringBuilder sb = new StringBuilder();
for(int i = 0; i < level; i++)
{
sb.Append("\t");
}
sb.Append(children);
return (sb.ToString());
}

Thursday, February 3, 2011

SharePoint 2010: How to enable developer dashboard

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$addsetting =$service.DeveloperDashboardSettings
$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand
$addsetting.Update()

SharePoint 2010: how to get SQL rows for a document in a library

Here's the snippet, just change the doc lib name and doc title.

select * from AllDocs d
join AllLists l
on d.ListId = d.ListId
and upper(l.tp_Title) = 'UPPERCASE DOC LIB NAME'
and upper(d.LeafName) = 'UPPERCASE DOC TITLE'
join AllUserData u
on u.tp_DocId = d.Id