WordPress function url_to_postid not working with Anspress

With the Anspress theme/plugin, using the WordPress native function url_to_postid() on a question permalink returns the page ID of the base page. For example,

would return the page ID of the /questions page.

To get the WP question ID of this-is-the-question, use the following:

(using get_post_types() instead of ‘questions’ allows the call to work even with permalinks of non-question contents.)

bbPress – Anonymous Subscriptions

This add-on plugin for bbPress will allow anonymous users to subscribe to topics and get email notifications when a new reply is posted. The notification email includes an unsubscribe link.

bbPress notifications will keep to go out to registered users, this plugin only extends the thing to anonymous posters as well!

Download (it’s free!)

bbPress - Anonymous Subscriptions

A case example with >100% subscription rate

This is vital for support forums, for example. On Post Pay Counter support forums, I did not want customers to sign-up: I wanted them to be able to request support in a matter of minutes, without any hassle. I liked the idea of “enter your name and email and you’re done!” But I also felt like they needed to be notified when someone replied to help. It was not compulsory, of course, but I would have wanted it as a customer.

Continue reading

A method for calculating pattern relevance in a text

This article aims at presenting a method for computing the relevance of a given string (pattern) in a text. This algorithm is at the core of my WordPress plugin Smart Tag Insert.

First of all, there is a difference between a simple pattern matching and computing text pattern relevance. The question we are trying to address here is the following: I have a string, and I would like to know how much that string is relevant for a specific text. For example, let’s say we have “download music” as the string of which relevance we are interested into. How can we determine how much relevant it is for a specific article?

The simple approach

The easy thing one could try is run a pattern match of “download music” in the article text. That is okay, but suppose the article contained strings like “download the music”, or “download some music”, or “downloading music”, or “download good quality music”. It is clear that, to a human, all these strings are equivalent when trying to understand what the article is about: it is about downloading music, regardless of whether it is good, bad, a lot or little.

A simple pattern match would fall short, because it would exclude all those other strings and make it look like the content is not very much about downloading music, just because “download music” was never found exactly that way.

So the first point we need to acknowledge if we want to try to teach a machine to compute text pattern relevance, is that we need to find a way, at least a rough way, to teach it to grasp the meaning of the content.

Continue reading

New System76 Lemur 2016 review (6th gen Intel core)

On December 2016 I purchased the System76 6th gen Lemur. These are more of impressions than a real review, but may be helpful if you’re interested in buying a new laptop and were considering the new System76 Lemur. This is the review of the laptop released in December 2015. I purchased the version with Intel Core 6th gen i3 6100U, 8GB DDR3 and 256 GB SSD.

Continue reading

IPSC 2014: Imagination is more important than knowledge

From 12th to 17th May I took part to the International Public Speaking Competition (IPSC) 2014 in London, representing my country, Italy. The topic was Imagination is more important than knowledge, and the title of my speech, which follows, was The largest dancing floor. The video of the italian version is available on YouTube or at the bottom here.

THE LARGEST DANCING FLOOR (Italian candidate speech)

What I propose today is a journey. A journey with our imagination, through physics, to disclose a picture of the world far more appreciable than the one we usually have.

Have you ever thought about how fake the reality we see is? Looking around us, we see all kinds of different things. And yet, it looks to me that we give for granted the most basic assumption, which is that these things exist as we see them. I mean, we see a penguin and we think that yeah, that’s the classic example of the capital-P Penguin, of the “penguiness”. But where is this “penguiness” to be seen? Can we think of it? Can we say it is real?

Continue reading

How Google Glass could be used for good while driving

The UK Department of Transports has banned Google Glass from driving since it could divert drivers’ attention from the road. I guess it is better to use your hands to dial a number or text someone instead of telling your glasses to do so without getting your hands off the wheel, but whatever. Anyway, they have not banned something that does not distract drivers, they have banned a product that could dramatically increase safety on the road. I can think of two ways it would, but I am sure there are plenty more. Here my two ideas for Google Glass while driving:
Continue reading