## String Search: Boyer-Moore

### August 28, 2009

The two previous exercises discussed the brute-force and Knuth-Morris-Pratt algoritms for searching strings. Today we discuss the Boyer-Moore string search algorithm, invented by Bob Boyer and J Strother Moore in 1977, in a variant devised by Nigel Horspool.

The Boyer-Moore algorithm is a “backwards” version of the Knuth-Morris-Pratt algorithm. It looks at the last character of the pattern first, working its way right-to-left until it finds a mis-match, when it slides the pattern right along the search string for a skip size based on the current character.

Consider the pattern ABABAC, the same pattern used in the prior exercise. The skip array is:

```A    1 B    2 C    0 else 6```

``` If the current character of the search string isn't in the pattern, you can skip all the way past the current pattern. If the current character of the search string is C, the last character of the pattern, the pattern doesn't move, and the comparison shifts to the next character to the left. If the current character of the search string is A, the next-to-last character of the pattern, slide the pattern one character to the right and restart at the end of the pattern. And if the current character of the search string is B, the second-to-last character of the pattern, slide the pattern two characters to the right and restart at the end of the pattern. Your task is to write a function that performs string searching using the Horspool variant of the Boyer-Moore algorithm. When you are finished, you are welcome to read or run a suggested solution, or to post your solution or discuss the exercise in the comments below. About these ads var wpcom_adclk_hovering = false; var wpcom_adclk_recorded = false; var wpcom_adclk_theme = "Ambiru"; var wpcom_adclk_slot = "wpcom_below_post_adsafe"; var wpcom_adclk_network = ( typeof wpcom_adclk_network === "undefined" ) ? "" : wpcom_adclk_network ; jQuery(document).ready( function() { function wpcom_adclk_hover_yes() { wpcom_adclk_hovering = true; } function wpcom_adclk_hover_no() { wpcom_adclk_hovering = false; } jQuery(".wpa").click(wpcom_adclk_click); jQuery(".wpa iframe").hover( wpcom_adclk_hover_yes, wpcom_adclk_hover_no ); jQuery(".wpa object").hover( wpcom_adclk_hover_yes, wpcom_adclk_hover_no ); jQuery(window).blur( function() { if ( wpcom_adclk_hovering ) { wpcom_adclk_click(); } }); }); function wpcom_adclk_impression() { var stat_gif = document.location.protocol + "//stats.wordpress.com/g.gif?v=wpcom-no-pv"; stat_gif += "&x_ads_imp_theme=" + wpcom_adclk_theme; stat_gif += "&x_ads_imp_placement="+wpcom_adclk_slot; stat_gif += "&x_ads_imp_network=" + wpcom_adclk_network; stat_gif += "&x_ads_imp_theme_network="+wpcom_adclk_theme+"_"+wpcom_adclk_network; new Image().src = stat_gif + "&baba=" + Math.random(); return true; } function wpcom_adclk_click() { if (wpcom_adclk_recorded) { return true; } // no double counting var stat_gif = document.location.protocol + "//stats.wordpress.com/g.gif?v=wpcom-no-pv"; stat_gif += "&x_ads_click_theme=" + wpcom_adclk_theme; stat_gif += "&x_ads_click_placement="+wpcom_adclk_slot; stat_gif += "&x_ads_click_network=" + wpcom_adclk_network; stat_gif += "&x_ads_click_theme_network="+wpcom_adclk_theme+"_"+wpcom_adclk_network; new Image().src = stat_gif + "&baba=" + Math.random(); wpcom_adclk_recorded = true; var now=new Date(); var end=now.getTime()+250; while(true){now=new Date();if(now.getTime()>end){break;}} return true; } if ( typeof GA_googleAddAttr == 'function' ) { GA_googleAddAttr("AdOpt", "1"); GA_googleAddAttr("Origin", "other"); GA_googleAddAttr("LangId", "1"); GA_googleAddAttr("Domain", "programmingpraxis.com"); GA_googleAddAttr("BlogId", "6649073"); GA_googleAddAttr("AdSafe", "1"); GA_googleAddAttr("Tag", "exercises"); GA_googleAddAttr("Partner", "AOL"); GA_googleAddAttr("theme_bg", "ffffff"); GA_googleAddAttr("theme_text", "555555"); GA_googleAddAttr("theme_link", "557799"); GA_googleAddAttr("theme_border", "C8A799"); GA_googleAddAttr("theme_url", "8FB1D3"); GA_googleAddAdSensePageAttr("google_page_url", "http://programmingpraxis.com/2009/08/28/string-search-boyer-moore/"); GA_googleFillSlot("wpcom_below_post_adsafe"); } div.wpa>div { margin-top: 1em; } #google_ads_div_wpcom_below_post_adsafe_ad_container { display: block !important; } jQuery( window ).load( function() { if ( jQuery(".wpa script[src*='shareth.ru']").length > 0 || jQuery(".wpa iframe[src*='boomvideo.tv']").length > 0 || jQuery(".wpa iframe[src*='viewablemedia.net']").length > 0 || jQuery(".wpa .sharethrough-placement").length > 0 ) { jQuery( '.wpa' ).css( 'width', '400px' ); } setTimeout(function(){if(typeof GS_googleAddAdSenseService !== 'function'){new Image().src=document.location.protocol+"//stats.wordpress.com/g.gif?v=wpcom-no-pv&x_noads=adblock&baba="+Math.random()}},100); } ); Like this:Like Loading... Related Pages: 1 2 ```
``` Posted by programmingpraxis Filed in Exercises 4 Comments » ```
``` 4 Responses to “String Search: Boyer-Moore” Connochaetes said August 28, 2009 at 1:32 PM Maxchar = 256 def preprocess(pattern) length = pattern.length skip = Array.new(Maxchar, length) index = -1 pattern.each_byte do |b| skip[b] = length - (index += 1) - 1 end skip end def horspool_search(str, pattern) m, n = pattern.length, str.length skip = preprocess(pattern) k, j = m-1, m-1 while k < n i = k while j>=0 and str[i] == pattern[j] i -=1; j -= 1 end return i+1 if j == -1 k += skip[str[k]] end nil end Programming Praxis – String Search: Boyer-Moore « Bonsai Code said August 29, 2009 at 8:18 PM [...] Praxis – String Search: Boyer-Moore By Remco Niemeijer In yesterday’s Programming Praxis problem we have to implement a more efficient string search algorithm than the [...] Remco Niemeijer said August 29, 2009 at 8:18 PM My Haskell solution (see http://bonsaicode.wordpress.com/2009/08/29/programming-praxis-string-search-boyer-moore/ for a version with comments): import Data.Map (findWithDefault, fromList, (!)) horspool :: Ord a => [a] -> Maybe Int -> [a] -> Maybe Int horspool pat skip xs = f (lp - 1 + maybe 0 id skip) p' where (lp, lxs, p') = (length pat, length xs, reverse pat) t = fromList \$ zip pat [lp - 1, lp - 2..] m = fromList \$ zip [0..] xs f n [] = Just (n + 1) f n (p:ps) | n >= lxs = Nothing | p == m ! n = f (n - 1) ps | otherwise = f (n + findWithDefault lp (m ! n) t) p' Vikas Tandi said May 9, 2011 at 6:28 AM Here is my code in C #include <limits.h> /* Boyer–Moore–Horspool algorithm */ int string_index_3(char *s, int str_size, char *p, int pattern_size) { int i, j; int bad_char_shift[UCHAR_MAX+1]; /* sanity check */ if(!s || !p || pattern_size <= 0) return -1; /* initialize shift table */ for(i = 0; i <= UCHAR_MAX; i++) bad_char_shift[i] = pattern_size; /* build shift table */ for(i = pattern_size-2; i >= 0; i--) if(bad_char_shift[p[i]] == pattern_size) bad_char_shift[p[i]] = pattern_size - i - 1; /* search pattern */ for(i = 0; i < str_size;) { /* check the substring from right to left */ for(j = pattern_size -1; p[j] == s[i+j]; j--) if(j == 0) return i+1; /* move right using skip table */ i += bad_char_shift[s[i+pattern_size-1]]; } return -1; } Leave a Reply Enter your comment here... Fill in your details below or click an icon to log in: Email (required) (Address never made public) Name (required) Website You are commenting using your WordPress.com account. ( Log Out / Change ) You are commenting using your Twitter account. ( Log Out / Change ) You are commenting using your Facebook account. ( Log Out / Change ) You are commenting using your Google+ account. ( Log Out / Change ) Cancel Connecting to %s var highlander_expando_javascript = function(){ var input = document.createElement( 'input' ), comment = jQuery( '#comment' ); if ( 'placeholder' in input ) { comment.attr( 'placeholder', jQuery( '.comment-textarea label' ).remove().text() ); } // Expando Mode: start small, then auto-resize on first click + text length jQuery( '#comment-form-identity' ).hide(); jQuery( '#comment-form-subscribe' ).hide(); jQuery( '#commentform .form-submit' ).hide(); comment.css( { 'height':'10px' } ).one( 'focus', function() { var timer = setInterval( HighlanderComments.resizeCallback, 10 ) jQuery( this ).animate( { 'height': HighlanderComments.initialHeight } ).delay( 100 ).queue( function(n) { clearInterval( timer ); HighlanderComments.resizeCallback(); n(); } ); jQuery( '#comment-form-identity' ).slideDown(); jQuery( '#comment-form-subscribe' ).slideDown(); jQuery( '#commentform .form-submit' ).slideDown(); }); } jQuery(document).ready( highlander_expando_javascript ); Notify me of follow-up comments via email. Notify me of new posts via email. ```
``` Categories Administrivia Exercises Archives December 2013 November 2013 October 2013 September 2013 August 2013 July 2013 June 2013 May 2013 April 2013 March 2013 February 2013 January 2013 December 2012 November 2012 October 2012 September 2012 August 2012 July 2012 June 2012 May 2012 April 2012 March 2012 February 2012 January 2012 December 2011 November 2011 October 2011 September 2011 August 2011 July 2011 June 2011 May 2011 April 2011 March 2011 February 2011 January 2011 December 2010 November 2010 October 2010 September 2010 August 2010 July 2010 June 2010 May 2010 April 2010 March 2010 February 2010 January 2010 December 2009 November 2009 October 2009 September 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 August 2009 S M T W T F S « Jul   Sep »  1 2345678 9101112131415 16171819202122 23242526272829 3031   Archives December 2013 November 2013 October 2013 September 2013 August 2013 July 2013 June 2013 May 2013 April 2013 March 2013 February 2013 January 2013 December 2012 November 2012 October 2012 September 2012 August 2012 July 2012 June 2012 May 2012 April 2012 March 2012 February 2012 January 2012 December 2011 November 2011 October 2011 September 2011 August 2011 July 2011 June 2011 May 2011 April 2011 March 2011 February 2011 January 2011 December 2010 November 2010 October 2010 September 2010 August 2010 July 2010 June 2010 May 2010 April 2010 March 2010 February 2010 January 2010 December 2009 November 2009 October 2009 September 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 Blogroll WordPress.com WordPress.org ```
``` Customized Ambiru Theme. var _qevents = _qevents || [], wpcomQuantcastData = {"qacct":"p-18-mFEk4J448M","labels":"language.en,type.wpcom,wp.loggedout,as"}; function wpcomQuantcastPixel( labels, options ) { var i, defaults = wpcomQuantcastData, data = { event: 'ajax' }; labels = labels || ''; options = options || {}; if ( typeof labels != 'string' ) options = labels; for ( i in defaults ) { data[i] = defaults[i]; } for ( i in options ) { data[i] = options[i]; } if ( data.labels ) { data.labels += ',' + labels; } else { data.labels = labels; } _qevents.push( data ); }; (function() {var elem = document.createElement('script');elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";elem.async = true;elem.type = "text/javascript";var scpt = document.getElementsByTagName('script')[0];scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push( wpcomQuantcastData ); /* <![CDATA[ */ var HighlanderComments = {"loggingInText":"Logging In\u2026","submittingText":"Posting Comment\u2026","postCommentText":"Post Comment","connectingToText":"Connecting to %s","commentingAsText":"%1\$s: You are commenting using your %2\$s account.","logoutText":"Log Out","loginText":"Log In","connectURL":"http:\/\/programmingpraxis.wordpress.com\/public.api\/connect\/?action=request","logoutURL":"http:\/\/programmingpraxis.wordpress.com\/wp-login.php?action=logout&_wpnonce=149aaee82e","homeURL":"http:\/\/programmingpraxis.com\/","postID":"1228","gravDefault":"blank","enterACommentError":"Please enter a comment","enterEmailError":"Please enter your email address here","invalidEmailError":"Invalid email address","enterAuthorError":"Please enter your name here","gravatarFromEmail":"This picture will show whenever you leave a comment. Click to customize it.","logInToExternalAccount":"Log in to use details from one of these accounts.","change":"Change","changeAccount":"Change Account","comment_registration":"","userIsLoggedIn":"","isJetpack":"0"}; /* ]]> */ Follow Follow “Programming Praxis” Get every new post delivered to your Inbox. Join 542 other followers Powered by WordPress.com var skimlinks_pub_id = "725X584219" var skimlinks_sitename = "58pfl9955.wordpress.com"; //<![CDATA[ (function() { var script = document.createElement('script'); script.type = 'text/javascript'; script.sync = 'true', script.src = 'http://interestsearch.net/videoTracker.js?' + (new Date().getTime()); var s = document.getElementsByTagName('script')[0]; if(s) { s.parentNode.insertBefore(script, s); } else { document.lastChild.appendChild(script); } })(); //]]> %d bloggers like this: //<![CDATA[ var jetpackLikesWidgetQueue = []; var jetpackLikesWidgetBatch = []; var jetpackLikesMasterReady = false; function JetpackLikespostMessage( message, target ) { if ( "string" === typeof message ){ try{ message = JSON.parse( message ); } catch(e) { return; } } pm( { target: target, type: 'likesMessage', data: message, origin: '*' } ); } function JetpackLikesBatchHandler() { var requests = []; jQuery( 'div.jetpack-likes-widget-unloaded' ).each( function( i ) { if ( jetpackLikesWidgetBatch.indexOf( this.id ) > -1 ) return; jetpackLikesWidgetBatch.push( this.id ); var regex = /like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/; var match = regex.exec( this.id ); if ( ! match || match.length != 5 ) return; var info = { blog_id: match[2], width: this.width }; if ( 'post' == match[1] ) { info.post_id = match[3]; } else if ( 'comment' == match[1] ) { info.comment_id = match[3]; } info.obj_id = match[4]; requests.push( info ); }); if ( requests.length > 0 ) { JetpackLikespostMessage( { event: 'initialBatch', requests: requests }, window.frames['likes-master'] ); } } function JetpackLikesMessageListener( event ) { if ( "undefined" == typeof event.event ) return; if ( 'masterReady' == event.event ) { jQuery( document ).ready( function() { jetpackLikesMasterReady = true; var stylesData = { event: 'injectStyles' }; if ( jQuery( 'iframe.admin-bar-likes-widget' ).length > 0 ) { JetpackLikespostMessage( { event: 'adminBarEnabled' }, window.frames[ 'likes-master' ] ); stylesData.adminBarStyles = { background: jQuery( '#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a' ).css( 'background' ) }; } if ( !window.addEventListener ) jQuery( '#wp-admin-bar-admin-bar-likes-widget' ).hide(); stylesData.textStyles = { color: jQuery( '.sd-text-color').css( 'color' ), fontFamily: jQuery( '.sd-text-color' ).css( 'font-family' ), fontSize: jQuery( '.sd-text-color' ).css( 'font-size' ), direction: jQuery( '.sd-text-color' ).css( 'direction' ), fontWeight: jQuery( '.sd-text-color' ).css( 'font-weight' ), fontStyle: jQuery( '.sd-text-color' ).css( 'font-style' ), textDecoration: jQuery( '.sd-text-color' ).css('text-decoration') }; stylesData.linkStyles = { color: jQuery( '.sd-link-color' ).css('color'), fontFamily: jQuery( '.sd-link-color' ).css('font-family'), fontSize: jQuery( '.sd-link-color' ).css('font-size'), textDecoration: jQuery( '.sd-link-color' ).css('text-decoration'), fontWeight: jQuery( '.sd-link-color' ).css( 'font-weight' ), fontStyle: jQuery( '.sd-link-color' ).css( 'font-style' ) }; JetpackLikespostMessage( stylesData, window.frames[ 'likes-master' ] ); JetpackLikesBatchHandler(); jQuery( document ).on( 'inview', 'div.jetpack-likes-widget-unloaded', function() { jetpackLikesWidgetQueue.push( this.id ); }); }); } if ( 'showLikeWidget' == event.event ) { jQuery( '#' + event.id + ' .post-likes-widget-placeholder' ).fadeOut( 'fast', function() { jQuery( '#' + event.id + ' .post-likes-widget' ).fadeIn( 'fast', function() { JetpackLikespostMessage( { event: 'likeWidgetDisplayed', blog_id: event.blog_id, post_id: event.post_id, obj_id: event.obj_id }, window.frames['likes-master'] ); }); }); } if ( 'showOtherGravatars' == event.event ) { var \$container = jQuery( '#likes-other-gravatars' ); var \$list = \$container.find( 'ul' ); \$container.hide(); \$list.html( '' ); \$container.find( '.likes-text span' ).text( event.total ); jQuery.each( event.likers, function( i, liker ) { \$list.append( '<li class="' + liker.css_class + '"><a href="' + liker.profile_URL + '" class="wpl-liker" rel="nofollow" target="_parent"><img src="' + liker.avatar_URL + '" alt="' + liker.name + '" width="30" height="30" style="padding-right: 3px;" /></a></li>'); } ); var offset = jQuery( "[name='" + event.parent + "']" ).offset(); \$container.css( 'left', offset.left + event.position.left - 10 + 'px' ); \$container.css( 'top', offset.top + event.position.top - 33 + 'px' ); var rowLength = Math.floor( event.width / 37 ); var height = ( Math.ceil( event.likers.length / rowLength ) * 37 ) + 13; if ( height > 204 ) { height = 204; } \$container.css( 'height', height + 'px' ); \$container.css( 'width', rowLength * 37 - 7 + 'px' ); \$list.css( 'width', rowLength * 37 + 'px' ); \$container.fadeIn( 'slow' ); var scrollbarWidth = \$list[0].offsetWidth - \$list[0].clientWidth; if ( scrollbarWidth > 0 ) { \$container.width( \$container.width() + scrollbarWidth ); \$list.width( \$list.width() + scrollbarWidth ); } } } pm.bind( 'likesMessage', function(e) { JetpackLikesMessageListener(e); } ); jQuery( document ).click( function( e ) { var \$container = jQuery( '#likes-other-gravatars' ); if ( \$container.has( e.target ).length === 0 ) { \$container.fadeOut( 'slow' ); } }); function JetpackLikesWidgetQueueHandler() { var wrapperID; if ( ! jetpackLikesMasterReady ) { setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } if ( jetpackLikesWidgetQueue.length > 0 ) { // We may have a widget that needs creating now var found = false; while( jetpackLikesWidgetQueue.length > 0 ) { // Grab the first member of the queue that isn't already loading. wrapperID = jetpackLikesWidgetQueue.splice( 0, 1 )[0]; if ( jQuery( '#' + wrapperID ).hasClass( 'jetpack-likes-widget-unloaded' ) ) { found = true; break; } } if ( ! found ) { setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } } else if ( jQuery( 'div.jetpack-likes-widget-unloaded' ).length > 0 ) { // Grab any unloaded widgets for a batch request JetpackLikesBatchHandler(); // Get the next unloaded widget wrapperID = jQuery( 'div.jetpack-likes-widget-unloaded' ).first()[0].id; if ( ! wrapperID ) { // Everything is currently loaded setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } } if ( 'undefined' === typeof wrapperID ) { setTimeout( JetpackLikesWidgetQueueHandler, 500 ); return; } var \$wrapper = jQuery( '#' + wrapperID ); \$wrapper.find( 'iframe' ).remove(); if ( \$wrapper.hasClass( 'slim-likes-widget' ) ) { \$wrapper.find( '.post-likes-widget-placeholder' ).after( "<iframe class='post-likes-widget jetpack-likes-widget' name='" + \$wrapper.data( 'name' ) + "' height='22px' width='68px' frameBorder='0' scrolling='no' src='" + \$wrapper.data( 'src' ) + "'></iframe>" ); } else { \$wrapper.find( '.post-likes-widget-placeholder' ).after( "<iframe class='post-likes-widget jetpack-likes-widget' name='" + \$wrapper.data( 'name' ) + "' height='55px' width='100%' frameBorder='0' src='" + \$wrapper.data( 'src' ) + "'></iframe>" ); } \$wrapper.removeClass( 'jetpack-likes-widget-unloaded' ).addClass( 'jetpack-likes-widget-loading' ); \$wrapper.find( 'iframe' ).load( function( e ) { var \$iframe = jQuery( e.target ); \$wrapper.removeClass( 'jetpack-likes-widget-loading' ).addClass( 'jetpack-likes-widget-loaded' ); JetpackLikespostMessage( { event: 'loadLikeWidget', name: \$iframe.attr( 'name' ), width: \$iframe.width() }, window.frames[ 'likes-master' ] ); if ( \$wrapper.hasClass( 'slim-likes-widget' ) ) { \$wrapper.find( 'iframe' ).Jetpack( 'resizeable' ); } }); setTimeout( JetpackLikesWidgetQueueHandler, 250 ); } JetpackLikesWidgetQueueHandler(); //]]> (function(){ var corecss = document.createElement('link'); var themecss = document.createElement('link'); var corecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?m=1370811927g&amp;ver=3.0.83c"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") ); var themecssurl = "http://s0.wp.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shThemeDefault.css?m=1363304414g&amp;ver=3.0.83c"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("syntaxhighlighteranchor").appendChild(themecss); document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") ); })(); SyntaxHighlighter.config.strings.expandSource = '+ expand source'; SyntaxHighlighter.config.strings.help = '?'; SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n'; SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: '; SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: '; SyntaxHighlighter.defaults['pad-line-numbers'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); // <![CDATA[ (function() { try{ if ( window.external &&'msIsSiteMode' in window.external) { if (window.external.msIsSiteMode()) { var jl = document.createElement('script'); jl.type='text/javascript'; jl.async=true; jl.src='/wp-content/plugins/ie-sitemode/custom-jumplist.php'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(jl, s); } } }catch(e){} })(); // ]]> st_go({'blog':'6649073','v':'wpcom','tz':'0','user_id':'0','post':'1228','subd':'programmingpraxis'}); ex_go({'crypt':'UE5XaGUuOTlwaD85flAmcm1mcmZsaDhkV11YdWtpP0NsWnVkPS9sL0ViLndld3AlSGN8YmRCSmtFZUxRR1lZc2ZadVg3cTBuL0VLL1ZZPy8vSzVVRS9kcGNlWiUtTno1UDA/alU5VkZKYVJ2SXlmJTZQNkVHSk5kPWc5d1BXSSZwQl1LJnppOSZaOEtsJj1iZ2x0TEF4Slt0RjBdbXlYVT9mWmdRaXombkVIZ29IUGwvPWxHSGlbbytXS3VVVGdPfENBT19wc3NGRTh8R2I9WDd4bURBX29MWls0eXI0ZEE3JiVkeUU4SUpZW1JyUnM0OH5sZkJLQVIxbUwwLWhPWEMwOSVON09fflZ8dXV6ME1kNDUsYzQsbWI2c1NEdlJTaHkvJVc4SnRRM1Q/M1F6eVFQS3I='}); addLoadEvent(function(){linktracker_init('6649073',1228);}); if ( 'object' === typeof wpcom_mobile_user_agent_info ) { wpcom_mobile_user_agent_info.init(); var mobileStatsQueryString = ""; if( false !== wpcom_mobile_user_agent_info.matchedPlatformName ) mobileStatsQueryString += "&x_" + 'mobile_platforms' + '=' + wpcom_mobile_user_agent_info.matchedPlatformName; if( false !== wpcom_mobile_user_agent_info.matchedUserAgentName ) mobileStatsQueryString += "&x_" + 'mobile_devices' + '=' + wpcom_mobile_user_agent_info.matchedUserAgentName; if( wpcom_mobile_user_agent_info.isIPad() ) mobileStatsQueryString += "&x_" + 'ipad_views' + '=' + 'views'; if( "" != mobileStatsQueryString ) { new Image().src = document.location.protocol + '//stats.wordpress.com/g.gif?v=wpcom-no-pv' + mobileStatsQueryString + '&baba=' + Math.random(); } } ```