<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on</title><link>http://salopst.yearl.us/tags/blog/</link><description>Recent content in Blog on</description><generator>Hugo</generator><language>en</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Tue, 21 Sep 2021 02:22:00 +0100</lastBuildDate><atom:link href="http://salopst.yearl.us/tags/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Eek! CodeColorer Wordpress plugin and PHP 7.1</title><link>http://salopst.yearl.us/eek-codecolorer-wordpress-plugin-and-php-7-1/</link><pubDate>Wed, 01 Mar 2017 14:33:33 +0000</pubDate><guid>http://salopst.yearl.us/eek-codecolorer-wordpress-plugin-and-php-7-1/</guid><description>&lt;p&gt;Having used the most excellent &lt;a href="http://he.net/"&gt;Hurricane Electric&lt;/a&gt; for the longest time I decided to relocate. In so doing I realised that I was moving from a PHP 5.2 to a PHP 7.1 environment. Gulp! Has it been that long. Expecting lots o&amp;rsquo; issues, but amazingly no. Just the tiniest of tiny issues:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PHP Warning: preg_replace&lt;span style="color:#f92672"&gt;()&lt;/span&gt;: The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/wp-content/plugins/codecolorer/codecolorer-core.php on line &lt;span style="color:#ae81ff"&gt;50&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="so-comment-out"&gt;So, comment out:&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;BeforeHighlightCodeBlock&lt;/span&gt;($content) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#sie&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;$this-&amp;gt;PerformHighlightCodeBlock(\&amp;#39;\\4\&amp;#39;, \&amp;#39;\\3\&amp;#39;, $content, \&amp;#39;\\2\&amp;#39;, \&amp;#39;\\1\&amp;#39;, \&amp;#39;\\5\&amp;#39;);&amp;#39;&lt;/span&gt;, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\(.*?)\(\s*)#sie&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;$this-&amp;gt;PerformHighlightCodeBlock(\&amp;#39;\\3\&amp;#39;, \&amp;#39;\\2\&amp;#39;, $content, \&amp;#39;\&amp;#39;, \&amp;#39;\\1\&amp;#39;, \&amp;#39;\\4\&amp;#39;);&amp;#39;&lt;/span&gt;, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $content;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="adding"&gt;adding&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;BeforeHighlightCodeBlock&lt;/span&gt;($content) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace_callback&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#si&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;($matches){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $this&lt;span style="color:#f92672"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;PerformHighlightCodeBlock&lt;/span&gt;($matches[&lt;span style="color:#ae81ff"&gt;4&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;5&lt;/span&gt;]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace_callback&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\(.*?)\(\s*)#si&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;($matches){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $this&lt;span style="color:#f92672"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;PerformHighlightCodeBlock&lt;/span&gt;($matches[&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;], &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;, $matches[&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;4&lt;/span&gt;]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $content;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Posting from IA Writer to Wordpress (Coleman)</title><link>http://salopst.yearl.us/blog-post-ia-writer-to-wordpress-with-ruby/</link><pubDate>Sun, 24 Apr 2016 00:01:57 +0000</pubDate><guid>http://salopst.yearl.us/blog-post-ia-writer-to-wordpress-with-ruby/</guid><description>&lt;h2 id="0-wha"&gt;0. Wha?&lt;/h2&gt;&#10;&lt;p&gt;With the coming of the new &lt;a href="http://stephen.yearl.us/rescue-doggie-diary/"&gt;doggie into the house&lt;/a&gt;, perhaps I will again add more content to the &lt;a href="http://stephen.yearl.us"&gt;bloggy thing&lt;/a&gt; that I have kinda sorta not really been keeping over the last little while.&lt;/p&gt;&#10;&lt;p&gt;Probably this has been done by someone else on the Intertubz, but ach, why not. I have some time on my hands, so here are running notes in &lt;a href="https://ia.net/writer"&gt;IA Writer&lt;/a&gt; that will make its way to a &lt;a href="https://www.wordpress.com"&gt;Wordpress&lt;/a&gt; post by some means or other. There’s nothing special about IA writer, by the way. Well, there &lt;strong&gt;is&lt;/strong&gt;, but not for the purposes of the Wordpress posting. The same code should work with any plain-ish text file coming from any editor.&lt;/p&gt;</description></item><item><title>74111101's The Universe questions</title><link>http://salopst.yearl.us/74111101s-_universe_-questions/</link><pubDate>Tue, 02 Apr 2013 14:03:45 +0000</pubDate><guid>http://salopst.yearl.us/74111101s-_universe_-questions/</guid><description>&lt;p&gt;74111101&amp;ndash; yes, my eldest insists on representing himself as the &lt;a href="http://en.wikipedia.org/wiki/ASCII"&gt;ASCII&lt;/a&gt; decimal &lt;a href="http://en.wikipedia.org/wiki/Code_point"&gt;code point&lt;/a&gt; values for his name&amp;ndash; and I have been watching the History Channel&amp;rsquo;s &lt;a href="http://www.imdb.com/title/tt1051155/"&gt;The Universe&lt;/a&gt;. Below some of 74&amp;rsquo;s questions (typed verbatim from his notes) that he hopes to have answered after writing to some of the presenters in the series.&lt;/p&gt;&#10;&lt;h3 id="questions"&gt;Questions&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;If the Universe keeps on expanding will it eventually rip apart the things that make up &lt;a href="http://en.wikipedia.org/wiki/Dark_energy"&gt;dark energy&lt;/a&gt;?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Is there a known limit to the repulsive effects of dark energy in the way that we know gravity does operate above or below certain distances?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Is dark enery strong enough to rip apart:&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Dark_matter"&gt;dark matter&lt;/a&gt; itself?, and&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;the atoms that make up stars and &amp;ldquo;regular matter&amp;rdquo;? How broken up will matter become? Can it go beyond &lt;a href="http://en.wikipedia.org/wiki/Elementary_particle"&gt;fundamental particles&lt;/a&gt;?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;If there is antimatter, is there antiDARKmatter?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Once the sun becomes a white dwarf, is it possible to combine all the gas in the &lt;a href="http://en.wikipedia.org/wiki/Planetary_nebula"&gt;planetary nebula&lt;/a&gt; and the &lt;a href="http://en.wikipedia.org/wiki/Outer_planets"&gt;outer planets&lt;/a&gt; to form another sun?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Is it possible to use the &lt;a href="http://en.wikipedia.org/wiki/Sun"&gt;sun&amp;rsquo;s&lt;/a&gt; energy to start &lt;a href="http://en.wikipedia.org/wiki/Nuclear_fusion"&gt;nuclear fusion&lt;/a&gt; and as the sun gets cooler to add more hydrogen to make it hotter and launch it into space?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;If dark energy is driving the expansion of the Universe will it eventually destroy the particles that cause dark matter? Will this then cause a &lt;a href="http://en.wikipedia.org/wiki/Big_Crunch"&gt;big crunch&lt;/a&gt; and possibly a new big bang?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>From Posterous to Wordpress</title><link>http://salopst.yearl.us/hello-world/</link><pubDate>Sat, 16 Feb 2013 21:56:25 +0000</pubDate><guid>http://salopst.yearl.us/hello-world/</guid><description>&lt;p&gt;The not-very-much-used-by-me Posterous is &lt;a href="http://blog.posterous.com/thanks-from-posterous"&gt;going offline&lt;/a&gt; on April 30th 2013, roughly 12 months after its acquisition by Twitter. I had a few on-and-off posts there, and I guess it would sort of be a shame to loose them, so this is an attempted replacement. The Posterous blog is copied here: &lt;a href="http://sjy.yearl.us/sjy/posterous/blog.yearl.us/"&gt;http://sjy.yearl.us/sjy/posterous/blog.yearl.us/&lt;/a&gt; &amp;hellip; that was a simple &lt;code&gt;wget -r -l inf -k -E -p -nc blog.yearl.us&lt;/code&gt; but I thought I&amp;rsquo;d also try and group these pages into Wordpress itself a lá &lt;a href="http://en.support.wordpress.com/import/import-from-posterous/"&gt;http://en.support.wordpress.com/import/import-from-posterous/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Wordpress</title><link>http://salopst.yearl.us/wordpress/</link><pubDate>Sun, 29 Jan 2012 14:02:46 +0000</pubDate><guid>http://salopst.yearl.us/wordpress/</guid><description>&lt;p&gt;Fsked the &lt;a href="http://mary.yearl.us"&gt;http://mary.yearl.us&lt;/a&gt; WP install last night whilst arsing with names. One single bloody typo in &amp;ldquo;site URL&amp;rdquo; and good luck getting back into the admin panel. WP does not even offer a warning that changing this might be a bad thing, or potentially so.&lt;/p&gt;&#10;&lt;p&gt;Fortunately having access to the database I could edit the value in-place in the tables&amp;hellip; now all is well again with the world.&lt;/p&gt;&#10;&lt;p&gt;&amp;hellip;except for the fact that I felt I had to sign up&amp;ndash;finally&amp;ndash; for a twitter account just so I could get an API key in order to explore some things on Mar&amp;rsquo;s blog. And it turns out another yearl.* has @yearlus as his handle. Grrr. for some reason this bothers me. Bothers me to the extent that I offerered him a free subdomain of his choosing under yearl.us. I&amp;rsquo;d take that deal if I were him.&lt;/p&gt;</description></item></channel></rss>