Thursday, November 17, 2011

Wednesday, November 16, 2011

iPad Mobile Safari Emulator

This goes for iPhone/iPod too:  iPad Emulator
  1. Run Safari
  2. Go to Edit -> Preferences, then go to the Advanced tab
  3. Check "Show Develop Menu in menu bar".  "Develop" now appears on the browser menu.
  4. Go to Develop -> User Agent -> Safari iOS ...

Tuesday, November 15, 2011

jQuery Summit 2011 Notes

Notes and links from some sessions of the jQuery Summit:

Wednesday, October 26, 2011

Strange ampersand from SharePoint 2010

Been noticing on term stores that if you enter an ampersand, SharePoint replaces the "&" with "&". I couldn't see anything different about it when inspecting the HTML or looking at it on Notepad++ with the "show all characters" turned on. So I'm assuming it has to do with different encoding.

It's not recognized as a regular ampersand by Server.HtmlEncode() nor by String.IndexOf().  Ended up doing a specific String.Replace("&","&") on it so the other functions could work with it.

Difficult to Google for "&", but did find some reference to ampersands on SharePoint 2010: Are Ampersands Stored Differently in SharePoint 2010 Than SharePoint 2007?

Friday, October 21, 2011

HTML5 Showcase

HTML5 Showcase:  "a gallery of the best html5 sites in the world"

CSS3.Info

CSS3.Info: "everything you need to know about CSS3"

Hide a row containing empty cells

Using jQuery, based on this StackOverflow thread:


$("tr").each( function() 
  if ($(this).children("td:not(:empty)").length > 0) { 
    $(this).show(); 
  } else { 
    $(this).hide(); 
  } 
});

Monday, October 3, 2011

Find all references to a page layout or master page

From Andrew Connell's blog:
  1. Go to the Site Content and Structure page.
  2. Open up the Master Page Gallery.
  3. Select one of the page layouts in the gallery.
  4. Click on "Show Related Resources" on the toolbar.

SPQuery subfolders

SPQuery.ViewAttributes on MSDN:
... if the Scope attribute is set to Recursive (Scope="Recursive"), the query displays all the files within a document library, including ones in subfolders. If it is set to anything else, the query displays only files in the top folder.

Friday, September 30, 2011

Deleting content types

If a content type refuses to get deleted, saying that it's part of an installed feature, try checking the following:
  • Deploy the solution that installs the feature.  And then activate and deactivate the feature.  (I am not clear on this part anymore; tried too many things.  And mumbling about SharePoint doesn't work.  I think the walk to the cookie store helped.)
  • Delete all pages that use the content type
  • Clean up the recycle bin of all pages that use the content type
  • Go to the master and page layout gallery and delete all page layouts that use the content type
[Update 07-Oct-2011:]
Warning:  Some sections here may require deleting parts of a site collection.  I haven't found a better way.  Good thing I only needed to do it on a dev or test server.  DO NOT do on a production server; find a different way.

Use the tip from here (which I found on this StackOverflow thread) to query SQL to see what's still referencing the content type.  You may end up having to delete some subwebs. :-(
And then use the tip from one answer from the StackOverflow thread to 
  • install the solution that had the feature that the offending content type
  • activate and deactivate the feature
  • go to the page layout gallery and delete the page layouts that came from the feature; make sure to clean them out of the recycle bin and from the site collection recycle bin
  • I think, at this point, when everything related to the content type was cleaned out, it no longer appeared on the content type list.

Thursday, September 29, 2011

When to use "using" (when to dispose) on SharePoint

Roger Lamb's dispose patterns.

Good one to remember about SPContext:
"SPContext.Current.Site & SPContext.Site as well as SPContext.Current.Web & SPContext.Web properties return SPSite and SPWeb objects respectively that DO NOT need a call to Dispose() and will be disposed automatically by SharePoint."

Saturday, September 10, 2011

Skype video calling on HeroTab C8 with Android 2.3

Install and configure Skype:
  1. Go to Android Market and install Skype.
  2. View the notifications and watch as it progresses through download and installation.  If you don't see it finish installing, you won't see it in the applications list, and you won't be able to download it again from the market--the install button won't appear anymore.  If that happens, you'll need to do a Factory Reset (goodbye to your apps, settings, and other data).
  3. Start Skype and sign-in.
  4. Go to Settings on the menu and enable video calling.
Warning:  Don't try to uninstall Skype, because you'll likely end up with the situation described in #2.  [Also saw other references to this upon some googling, as in:  you'll need to do a hard reset to re-install Skype.]


Initiating a call:
  1. Select a contact and start a "Skype call".  This is very important:  do not try to start a video call from the tablet, because the app will crash and you'll get this error:  "The application Skype (process com.skype.raider) has stopped unexpectedly.  Please try again."
  2. Your contact should click on the "answer with video" button.
  3. Tap your tablet and tap on the videocam icon.
  4. Tap on the "Back camera" option (there's only one camera on the HeroTab, and it's actually front-facing).
  5. The screen will show your video and then your contact's video in a little window.  Double-tap on the little window to switch them.  Your contact's video will now take up the whole screen in landscape mode (as far as I can tell, it can't go portrait mode).

Receiving a call:
  1. Have your contact start a "Call" (not a "Video call").  If they start a video call, the Skype app on the tablet will turn around and call the caller instead.  If they accept that video call, then they'll see your video.  But you'll only see your own video.  Meh.  :-(
  2. When the call arrives on the tablet, click on the green "Video" button.
  3. The caller will see a message saying they'll need to turn on their video.  The caller need to click on the "My video" cam icon.
  4. The caller's video window now appears on the tablet.  Double-tap on it to make it the full-screen window.

This information worked for me today (2011-Sep-10).  It will likely change for later versions of either the Skype app or Android.

Wednesday, September 7, 2011

Cheat sheets for CSS3, HTML5, etc

Veign.com has some pretty cool guides on their development center.

CSS3 PIE

"PIE makes Internet Explorer 6-9 capable of rendering several of the most useful CSS3 decoration features."

Thursday, September 1, 2011

Tuesday, August 30, 2011

Hide Site Links menu

Hide the Site Links menu on SharePoint 2010 by adding a SPSecurityTrimmedControl around this element:
<span class="ms-siteactionsmenu" id="siteactiontd">
(see reference)

Friday, August 5, 2011

Building a custom PC

Find out how to build a custom PC at Hardware Revolution.

Debugger problem "The breakpoint will not currently be hit. No symbols have been loaded for this document"

Got this message while trying to debug a web service in VS2008: "The breakpoint will not currently be hit. No symbols have been loaded for this document."
Found that the following (from comments here) fixed it for me:
"If you are using the vb profile, then when you hit F5 you will get a debug build, but if you hit build you will get a retail executable. The simplest way to get things working again is to go to delete the bin directory under the solution/project path and then hit F5 again."

Wednesday, August 3, 2011

Video for Everybody by Kroc Camen

From Modernizr Documentation:
"See Video for Everybody by Kroc Camen for a JavaScript-less way to use HTML5 video with graceful fallbacks for all browsers..."

Tuesday, August 2, 2011

Modernizr

From the Modernizr site:
"Modernizr is a small JavaScript library that detects the availability of native implementations for next-generation web technologies, i.e. features that stem from the HTML5 and CSS3 specifications..."

Force Chrome refresh, ignoring cache

Saw info regarding Ctrl-Shift-R (here and here).  Hope it works.  Debugging scripts gets very frustrating when the browser keeps looking in cache instead of my changes.

Opening Chrome links on new windows instead of new tabs

Force Chrome to open new pages in new window, not tab? (when opened from a program)

Tuesday, June 14, 2011

Understanding locale and culture display names

Needed to get the plain language native name, without the additional country/region info. Use this:

CultureInfo.Parent.NativeName

More info here in Shawn Steele's post: Understanding locale & culture "display" names

Thursday, June 9, 2011

Friday, May 13, 2011

Monday, May 9, 2011

Dotted HR on IE7

From lasiman's comment in this article:
"REAL DOTTED without Image can be accomplished by:
border:0px; border-top:1px dotted #000000; height:0px;
works in all browsers..
have a good day.."

Monday, May 2, 2011

Getting outerHtml with jQuery

From Volomike and jessica's answers on http://stackoverflow.com/questions/2419749/jquery-get-selected-elements-outer-html:  use .clone() and .wrap() with .parent() and .html().  Here it is as an extension:

$(function() {
  $.fn.outerHTML = function() {
    return $(this).clone().wrap('<div></div>').parent().html();
  }
});

and use it like this:
  $("#myItem").outerHTML();

Tuesday, April 26, 2011

Resizing a VirtualBox virtual hard disk

Resize An Existing .vdi Virtualbox Image – EASILY!
Followed the steps from this article and from comment #12 from this one to expand a 50Gb vmdk into a 70Gb vdi:
  1. Created a new VM and added a new 70Gb dynamic IDE drive.  (IDE is important; it didn't boot when I had it set to use the SATA controller.)
  2. Use VboxManage to clone the original cramped disk into the new larger disk:
    VboxManage  clonehd origHdd.vmdk  newHdd.vdi  --existing
  3. Start the new VM.
    My VM was a Windows 2008 server, and it worked fine when I simply expanded the partition into the new space.  My drive now has 70Gb!

Wednesday, April 6, 2011

Handling iPhone events

Tuesday, March 22, 2011

Media queries for standard devices

Targeting different devices via @media in CSS:
Media Queries for Standard Devices

Safari Firebug alternative

How to show the developer console on Safari:
Under Preferences, go to the Advanced tab and check "Show Develop menu in menu bar".
Display/unhide the menu bar.
Click on "Develop" on the menu bar and click "Show Web Inspector".

jTweetsAnywhere: a jQuery Twitter Widget

Found jTweetsAnywhere while looking for a plug-in that guards against exceeding Twitter's rate limits.  Haven't tried it yet, but putting it here to remember for later.

HTML5 Resources

A Brief History of Markup (up to HTML5)

The first chapter of "HTML5 for Web Designers" by Jeremy Keith.

Friday, March 18, 2011

Targeting :first-child on IE6

This article shows a way to target the :first-child pseudoclass on IE6 using an expression to check if previousSibling is null, like so:

table.mytable td
{text-align: expression(this.previousSibling==null?'center':'left');}


Another way I've found is to use the childNodes of the element's parentNode, which is useful for targeting multiple columns in a table (yes, it's a table, but it's being used to display real tabular data in the case I'm working on), and when the col tag isn't enough to style the columns:

table.mytable td
{text-align: expression(this==this.parentNode.childNodes[0]?'center':'left');}

Monday, February 14, 2011

Content Type Feature Manifest: Field Element

Attributes of the Field Element.  For some reason this isn't the easiest info to find on MSDN, so I'm noting it here.

Wednesday, February 2, 2011

Notepad++ CRLF instead of LF

Looks like Notepad++ by default has EOL settings so that only LF is placed at the end of each line.  Which is fine in Notepad++ but not when you have to open the file in plain old Notepad--the lines run together.
To change the EOL settings, go to Edit->EOL Conversion, and set it to "Windows Format" instead of "Unix Format".

Tuesday, February 1, 2011

Adjust frames per second for jQuery animations

Use jQuery.fx.interval.
Note from jQuery documentation:
"This property can be manipulated to adjust the number of frames per second at which animations will run. The default is 13 milliseconds. Making this a lower number could make the animations run smoother in faster browsers (such as Chrome) but there may be performance and CPU implications of doing so."

Tuesday, January 11, 2011

Use AuthoringContainer with EditModePanel in SharePoint 2010

In SharePoint 2010, the EditModePanel control's PageDisplayMode attribute no longer works the way it used to in SharePoint 2007.  Found out in this article that you'll need to pair it with the AuthoringContainer control to get the behavior that EditModePanel had in SharePoint 2007.

Thursday, January 6, 2011

Extra 2-3px below Flash object on Firefox

To get rid the extra space below the Flash object on Firefox, set the style for the object element to "display:block".  (Tip from Dynamic Drive Forums.)