Smokes your problems, coughs fresh air.

Category: BigSmoke.US (Page 1 of 3)

About this domain.

The decade-old posts bug

I just noticed that none of my posts older than a decade could be listed:

The culprit was in the following function, where I had to add "century" and "10" to the lists of $periods and $lengths respectively.

function bigsmoke_ago($timestamp_gmt)                                                    
  $difference = current_time('timestamp', true) - $timestamp_gmt;                        
  $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
  $lengths = array("60","60","24","7","4.35","12","10");                                 
  for($j = 0; $difference >= $lengths[$j]; $j++)                                         
    $difference /= $lengths[$j];                                                         
  $difference = round($difference);                                                      
  if($difference != 1) $periods[$j].= "s";                                               
  $text = "$difference $periods[$j] ago";                                                
  if ($j < 3) {                                                                          
    $current_day = date('j', current_time('timestamp', true));                           
    $arg_day = date('j', $timestamp_gmt);                                                
    $relative_day = ($current_day == $arg_day ? 'today' : 'yesterday');
    $text = "$relative_day, $text";                                                      
  return $text;                                                                          

While add it, I also got rid of the useless Google ads.

Plus, I improved the link text replacement for posts without comments and commenting turned off.

The terrible state of my tech

It’s a bit pathethic how well I have been taking care of my own tech. ever since I started studying. What’s worse: this haven’t improved when I stopped my studies for other ventures. I think the reason for this is exceedingly simple: I don’t like to do work-like things I don’t write about; luckily, I love to structure my goals in writing, and this blog still hasn’t completely collapsed under my neglect.

If I love writing about stuff I do, have I simply not done anything in the past few years? Well, I’ve done things. I’ve even written about them too, in other places, mostly on paper. It’s just that, dispite working for a tech company for the last couple of years, I have done hardly a thing about ridding myself of my private technical debt. Or is it because of working at a tech company, where I’m hard at work fighting technical debts in Python/Django projects and documenting the progress in Redmine?

I won’t mention the reasons why I want to spend time on this weird, hodgy-podgy blog again. Let me just say that the main motivation is not guilt for having created a technical debt. And the actual reasons are better suited for other posts at another time.

Domain Problem Short-term fix Mid-term fix Long-term fix Spam ✔ 2017-07-18 Disable comments and ping/trackbacks on new posts.
2017-07-18 Disable comments and ping/trackbacks on old posts.
2017-07-19 Remove spam.
Security Upgrade WordPress svn:external Automatically upgrade WordPress Non-responsive Make responsive
Outdated 2018-10-28 Reduce and update content
* Huge hosting costs Find sinkhole between my NFSN accounts 2019-01-26Move to cheapsolid VM host (TransIP? Tilaa) Security Move personal posts to and replace with redirects
Replace blog with static rendering of blog
opschoot Wheezy fan Replace or re-attach fan.
Neglected backups Backup monitoring: opschoot should register itself when online and I should then be nagged if I don’t backup.
butler Legacy Move files somewhere else (public?)

Using papercite WordPress plugin for academic note-taking

During most of my bachelor, I’ve used paper and pen or pencil to take notes. Halfway my second minor [Okasys], though, I switched to my laptop and LaTeX, which I preferred, because typing is faster than writing and reworking my notes into a halfway decent summary usually proved too time-consuming with hand-written notes. Admittedly, though, although reorganizing my notes became easier with LaTeX, I still didn’t really get to the finished summary stage, because I’m still way too obsessive-compulsive about the whole thing, most of the time. Now, since I figured I use my blog for all sorts of notes, I can just as well let WordPress and Google do some of the organizing for me, while taking notes for my present course. I just have to be a bit more careful about copyright issues (but, if the need strikes, I can always set a post to private).

There are various WordPress plugins for keeping track of academic references. I’m now experimenting with papercite [documentation. From the feature list, I was more interested in the AcademicPress plugin, but the former seems te be more actively developed. However, I’m thinking of switching to a simple footnotes and/or endnotes plug-in, since my use of papercite so far actually doesn’t include maintaining biography files shared by more than one post, and papercite doesn’t support author-year citations anyway. I’m surrounding the text with [bibshow file=custom://data][/bibshow] shortcodes, which references a BibTeX biography stored in a custom field called papercite_data.

Installed MathJax-LaTeX WordPress plugin for

Soon, I wish to document some statistical issues I’ve been running into lately due to the lack of understanding maintained by my recipe-level statistics training. Also, I’d like to document some of the things I did learn over the years, and, hopefully, the things I find out while working myself out of the modelling mountain that I currently find so difficult to mount. For this I will need to use some mathematical language, which is why I just installed the MathJaX-LaTeX WordPress plugin. MathJax-LaTeX uses the MathJax JavaScript library to support LaTeX and MathML math equations in WordPress without requiring the browser to have MathML support.

As for testing it, my knowledge (\(K()\)) of MathML (\(M\)) is pretty much nonexistant, while I’m quite comfortable with LaTeX (\(L\)) math exations, which is why I’m typing the LaTeX code “K(M) \ll K(L)” to generate the following simple equation:

\(K(M) \ll K(L)\)

Commenting fixed for

To my great surprise, thanks to Tobias Sjösten, I found out that commenting was broken on I couldn’t pinpoint the exact problem, but it must have been introduced with some WordPress upgrade somewhere along the line. I never noticed it because it did work for logged in users. (If I must really guess, I suspect a silent ReCaptcha version compatibility problem.)

Upgrading WordPress and wp-recaptcha to their latest versions (3.3.1 and 3.1.4 respectively) seems to have solved the problem.

Blogging: quantity over quality

They say that blogging is a long way down from essaying. Articles were already better than essays, and books even more so. So they say. A lot is said these days. I say: the more, the merrier. I say: let us say! Let us say whatever we want. And let people read whatever they want, now that they can.

I try to blog as much as I can, not because I think that each post is a piece of poetry that needs to be enjoyed by as many as possible, but because each post represents a train of thought that I need to get rid of. The sooner, the better. Noise is not a problem. The Internet is filled with noise, but nevertheless we only read what we want to read and we still find what we need. We filter. If you don’t, good luck surviving the digital age.

There is a convergence movement towards media integration. Eventually, this will lead to the collapse of all these media, meaning that the need for distinct, specific media will be less and less. This is good. We need to be truly press-less before the original promise of the press can be fulfilled: information liberation.

What I mean by this is that, when we publish, we don’t need to make a clear distinction between the weighty and the weightless. After all, God Google defines the weight of our publications not by means of what we say about it, but by means of incoming link frequency and the relative weight of these links.

When I say something worthwhile, I first have to convince others that I did, but before I can do that, I have to convince them to come look. Then, after visiting me and having been convinced by my great content, they might decide to link to me. Only as soon as that happens, do I gain weight. (According to Technorati, the weight of this blog is pathetic.)

Not every post I write resembles even an essay. Most postst don’t even come close. That’s because blog posts don’t need a point. I’ve made this point before, but I can’t repeat it often enough, because every time that I’m thinking “Shit, what did I do then and what was I thinking?” I’m reminded of it. I’ll stop reiterating this no sooner than I stop forgetting to write these things down.

When a blog post does attempt to make a point, there are even stronger arguments for quantity over quality, because publishing—really publishing—something makes it possible for others to respond, be this in comments or in their own blog. There’s something concrete for them to cite and to reference. This process gives me valuable feedback and I can simply republish my thoughts (which have matured not only through time, but also through argument) in a new post. Voila! And maybe the old post is so shitty that nobody is interested… Who cares?! Obviously, they don’t! So go on and do something else with the time that you’ve freed by not having to polish a turd.

Remember that blog posts are not naturally organized into some sort of reading hierarchy. There’s no reason that the same subject can’t be treated twice. Just hit that “Publish” button, get it out of your head and get on with your life!

100th post!

Fireworks reflect off the waters of Pickering Wharf in Salem, MA while the "Friendship" takes it all in.

Fireworks reflect off the waters of Pickering Wharf in Salem, MA while the Friendship takes it all in. Photograph by Flickr user snowriderguy.

I just published the 100th post here on Who would have thought that when I published my first post?

(Actually, that first post, although the first post to have been published through this blog, is no longer chronologically the first, not since I started backposting my older regular website content on this blog.)

Hopefully, the 1000th post will be a bit sooner than the 100th post; I still keep stumbling upon issues that I wish I had blogged about so that I don’t have to solve them twice. Also, there’s a lot of content that got stuck in the feeling of formality that was induced by having to give it a permanent place on a static website. That feeling made me want to elaborate beyond what was actually in my head at any given moment. This blog induces less and less of such inhibitions, which in turn generated more and more content.

Blog posts don’t need a point

I take blogging very literal. For me, the primary use of a weblog is to keep a log of (complicated) thoughts and activities. The reason to keep a log is very self-evident: to be able to find out how and why I came to some solution or how far I was in the problem-solving process. This becomes ever so clear to me when I find myself confronted with finding out something which I’m sure I already did.

Most of the time I still don’t think about blogging my thoughts because I associate writing with making a point and supporting that point well. That association is a mistake. Instead, I would like to cultivate the following reasons to blog:

  1. Writing is fun because sharing is fun.
  2. Writing is fun because reiterating an experience is liberating.
  3. Redoing my research and problem-solving is not fun.
  4. Receiving comments to your writing is fun.
  5. The very act of writing down an unsolved problem often reveals the solution.
  6. If it doesn’t, some visitor will.
  7. Often a problem is really not a problem at all. Trying to formulate such a problem will make this painfully obvious.

Blog posts don’t need a point, blogging is the point.

Finding a decent GeSHi plugin for WordPress

I like GeSHi (enough even to have written a language file for it). For ages now, I’ve used a WordPress plugin by Dan Peverill. But for as long as I’ve been using the plugin, I’ve been looking to get rid of it.

Dan Peverill’s GeSHI plugin sucks for two reasons:

  1. It’s no longer being maintained. It doesn’t even seem to justify a page on Dan’s website anymore (for which reason I’m not going to give him any link-juice).
  2. It breaks HTML. With the plugin enabled I can no longer use the <code> tag to mark in-line elements as being code. Frankly, this is annoying and I find myself typing <tt> often when I mean <code>.

A search for WordPress plugins tagged GeSHi reveals a number of results: Sniplets, CodeColorer, Developer Formatter, and WP-SynHighlight. WP-Syntax is a plugin that is missing from the tag search.

Sniplets seems much too generic to my taste. I just want a GeSHi highlighter, period.

CodeColorer says it does what I want, but if I ever want to use the TinyMCE editor again, I won’t be able to with this plugin. Shouldn’t be too much of a problem, but still…

Developer Formatter is very thoroughly written and even sports a TinyMCE plug-in for copying/pasting the code. It is pretty big, though, and, as a rule, I tend to avoid plug-ins that complicate the database schema. I also don’t really see how these extra tables are an advantage feature-wise.

WP-SynHighlight uses a custom BBCode-style tag, [codesyntax] I like this (if you’re going to use pointy brackets, at least keep out of the HTML namespace), though I don’t like the attempt at a generic name; what’s wrong with calling the tag [geshi]? Seriously… I’m sure I’m going to forget this name billions of times if I’ll use this plug-in.

WP-Syntax uses the <pre> tag with a few custom attributes. This at least is better than the officially inline <code> tag that my current plugin uses, because most of the time that I’d use a <pre> tag I really do want syntax highlighting. Just wondering: will it also allow my to use it normally for that other rare occasion? Sadly, the plugin will doubtlessly wreak havoc with the visual (TinyMCE) editor.

So, which plugin will I choose? I am somehow inclined to want a plugin that can play nice with the visual editor because I keep telling myself how much nicer it would be to switch to the visual editor for all my posting. (That this will be difficult because I disabled WP’s ‘wpautop‘ filter to rid myself of its eagerness is a story for some later time.) This requirement rules out CodeColorer and WP-Syntax.

That leaves Developer Formatter and WP-SynHighlight. Both seem to fit my purpose. Developer Formatter sports a nice TinyMCE plugin for inserting code, but I don’t think that switching to TinyMCE will suddenly and unexpectedly make me afraid of typing. Besides, I really don’t want the extra tables in my database without a very good reason, so, for now, I will try WP-SynHighlight.

« Older posts

© 2024 BigSmoke

Theme by Anders NorenUp ↑