@Ron @JohnPhilpin this is a test status post from my WordPress blog, see if you can reply to this post in micro.blog, thanks.

Working with callbacks in Javascript

I am playing with the sample code for Dave Winer’s feedRead Github repo, and wanted to refactor one of the examples. I have seen multiple examples of a callback function source code included in a call to another function, but I wanted to have it be a separate function. Here is the example code:
[cc lang=”javascript”]
feedRead.parseUrl (urlTestFeed, timeOutSecs, function (err, theFeed) {
if (err) {
console.log (err.message);
}
else {
console.log (“It took ” + utils.secondsSince (whenstart) + ” seconds to read and parse the feed.”);
console.log (“theFeed.head == ” + utils.jsonStringify (theFeed.head));
console.log (“theFeed.items [0] == ” + utils.jsonStringify (theFeed.items [0]));
for (var i = 0; i < theFeed.items.length; i++) {
console.log (“Item #” + utils.padWithZeros (i, 2) + “: ” + theFeed.items [i].title + “.”);
}
}
});
[/cc]
After some experimenting, I figured out that all I needed in the feedRead.parseUrl call was the function name (with no parameters, even though it had parameters), and then the function could be factored out:

[cc lang=”javascript”]
feedRead.parseUrl (urlTestFeed, timeOutSecs, myparser);

function myparser (err, theFeed) {
if (err) {
console.log (err.message);
}
else {
console.log (“It took ” + utils.secondsSince (whenstart) + ” seconds to read and parse the feed.”);
console.log (“theFeed.head == ” + utils.jsonStringify (theFeed.head));
console.log (“theFeed.items [0] == ” + utils.jsonStringify (theFeed.items [0]));
for (var i = 0; i < theFeed.items.length; i++) {
console.log (“Item #” + utils.padWithZeros (i, 2) + “: ” + theFeed.items [i].title + “.”);
}
}
}
[/cc]

Note that the function does not have a semicolon at the end, but the call to feedRead.parseUrl does…

References:

https://codeburst.io/javascript-what-the-heck-is-a-callback-aba4da2deced

https://javascriptissexy.com/understand-javascript-callback-functions-and-use-them/

Getting some traction on micro.blog

I made a post on Sunday, and it triggered a nice stream of comments from people on micro.blog, all of which appeared as comments on my post. Cool! It looks like the webmention support on both ends is working well. As another step in WordPress/micro.blog integration, I am adding my comments RSS feed as a cross-posted feed. After I post this, I will add a comment and see if that appears on micro.blog. Let’s see what happens!

Wither the history of podcasting?

This week, I listened to episode 167 of the Radio Survivor podcast, titled “Alternative Histories of Podcasting“. The guest was Andrew Bottomley of SUNY-Oneonta, and the conversation covered the “popular” start of podcasting (Dave Winer, Christopher Lydon, Adam Curry, et al), and a look at audio available on the Internet before the 2004-2005 time period. The hosts seemed to take issue with defining “podcasting” as the technical tools making it possible to subscribe to audio files (podcasts) and easily load them to mobile devices (MP3 players, smartphones). I do not deny that the examples that Dr. Bottomley gave of Internet audio files pre-2004 were correct, but I think there is a reason why they were not called podcasting – because there was no “pod” available! For better or worse, the iPod was the first convenient audio player, iTunes was the first convenient way to get audio on a device, and the name “podcasting” grew out of the development of these tools and other tools of audio production and distribution.

I hope that Dr. Bottomley will document his research in this area (seems like he is working on a book). However, I am more interested in finding good podcasts to listen to, and playing around with creating podcasts myself. As Dave Winer has pointed out, creating and distributing podcasts is an open platform – anyone can do it. People can disagree on “who was first” or “what is a podcast”, but I want to focus on the practitioners, the people who are creating podcasts, no matter what the topic.

Knowledge wiki examples

Chris Aldrich posted about an interesting knowledge wiki using Github as the storage of the original content and using Gitbook to render the content. I have a federated wiki instance I have been using for some topics. Chris Aldrich also mentions that his own site serves as a commonplace book, capturing information that interests him. I think this variety of tools and practices is good to see. I have used a weblog in the work environment as a knowledge capture tool, then migrating some content to a wiki. My main observation is a common one: you get out of it what you put into it. If you don’t do much, any tool you use will not be very helpful. If you contribute content on a regular basis, the value will grow and grow over time. Which will you choose?

The effect of music in our lives

Earlier this week, I read a terrific post by Ron Chester on the effect of silence at the end of the performance of a piece of music. I sing in a church choir, and there have been many times that a short silence at the end of a piece can really bring home the feeling of richness to the experience. During the past weekend, I also had two musical experiences that reminded me of the power of live music. I sang at a church retreat, and attended a community band concert. In the retreat, I was moved to tears at one point by one of the songs as I sang. At the band concert, several of the pieces were ones I had played when I was in band in high school or college, and the pieces brought back fond memories of making music with a group. It also helped that the band was excellent, easily the best community band I have ever heard. All of these experiences helped to remind me that having music in my life is an uplifting experience, one that I want to continue to have.