Rails Api and Vue.js with Webpack (Rails 5.2)

Rails since 5.1 comes with built in support for Webpack. When issuing a rails new command we can add [--webpack=WEBPACK] which has the explanation:
# Preconfigure for app-like JavaScript with Webpack (options: react/vue/angular/elm/stimulus) and here I’m going to show how Vue.js is set up out of the box. As we’re letting Vue.js handle the front-end let’s install rails with the --api option which makes controllers render models as JSON by default and slims the V part of the MVC in Rails – bonus, no more TurboLinks (it being the work of the devil) and no more CoffeeScript either which reduces our cognitive load. Plain ol’ Javascript for the proverbial. The command line I use is: rails new [my app] --api --webpack=vue -T where the -T skips test files because I use the RSpec testing framework. Webpack is handled by the Webpacker gem, deets here. A lot of Ruby and Node.js magic happens courtesy of this command compared to a simple Rails install.

Continue reading…

Internet + Ideology

At some point in 2010 or thereabouts as the Arab Spring unfolded with its revolutionary tide breaking across the shores of Mediterranean nations a thought struck me.

This unfolding was at the time attributed to (or at least said to be greatly enabled by) social media platforms – oh the internet, that great liberalizing force. I wasn’t falling for that simple narrative. (I try not to fall for overly simplistic just-so narratives.)

How will our digital landscape come to affect the spread of ideas and beliefs? Especially deeply held beliefs? A deeply important concern, I thought. Thus, Internet + Ideology was born.

A couple of years later I turned the ideas into a research proposal and submitted to UCD. The topic was accepted but I never pursued it because the acceptance did not come with a stipend.

I’m uploading this document here because I no longer want my ideas locked up inside my head. Go ahead, give it a read. As populist movements continue to roil Western nations I am drawn back to these thoughts. Another day I’ll expand on them.

How to police online content that transgresses community standards in as fair a way as possible

As I thought about this deep problem (policing the boundaries of free speech) I realised that *moderate* means both to be free from excess and to decide whether something stays or not on a forum. Say what you want about the U.S., free speech *maximalists* ought to be glad the internet (and with it a lot of internet culture) started in the U.S. what with its long history of constitutionally protected free speech.
If an internet forum is to self police and to not rely on the actual bobbies to police its content then it makes sense that content on that forum is policed in as transparent, fair, and dare I say it, democratic a manner as possible.

Continue reading…

The reports of my cyber-demise have been greatly exaggerated

Good day,

This post is half political, half confessional, and half dyscalculical.

Few like having their core beliefs called into question. That’s why philosophy is a tough old slog. That’s not to say that the many other parts of life that require critical thinking are not a tough old slog. Generally speaking though few disciplines compel a person to be wary of their unexamined beliefs quite to the same extent that philosophy compels them†. We look at the world through the window of our beliefs, which is why people come to radically different conclusions about identical circumstances. The more fearless the philosopher the more transparent and without defect the window. This is one reason to mistrust technocrats, formalists, and all those who would instruct with mathematical, formal, or technical language.

Continue reading…

The Great Disconnect and Digital Exile

I come from a country where in the last century a number of our most famous writers have left these shores for a life of enforced exile. You’re not going to compare yourself to Beckett or Joyce now (are you?) I hear you ask in disbelief. Why no, not at all. But I have been trying to construct an analogy for what I feel must be done to reclaim ourselves in these empty digital times.

I will be leaving the world of social media and instant messaging. Not that anyone will care. I have few followers on any given platform, nobody hangs on to my every given word. And that’s okay with me.

Continue reading…

Cambrian Explosion in Abstraction (part i)

The Cambrian Explosion as you’ll remember refers to an epoch recorded in the fossil record which is known as, in the words of noted archaeologist Bill Bryson, “[…] the moment when complex life burst forth in dazzling profusion — the famous Cambrian explosion”. We’re talking 500-million-plus years ago.

I want to suggest that something similar happened in the Axial Age roughly 2,500 ago, but with thought. According to Karl Jaspers in his work Origin and Goal of History something profound or pivotal happened between the 8th century BCE and the 3rd century BCE in China, India, and Greece. World-spanning religions were formed. Itinerant scholars† plied their trade. According to Karen Armstrong in The Great Transformation what is now called The Golden Rule was formulated simultaneously and what seems like independently. Axiomatic math was laid out by a dude called Euclid. David Graeber in Debt: The First 5000 Years‡ argues that it is the simultaneous and independent invention of coinage that spurred this social complexity. But to have coinage one must have not just the technology but the idea of coinage. Witness bitcoin where tech capability pre-dated invention by 30 years or so. And for an idea like coinage one needs abstraction. And we know what that age also gave us, the birth of philosophy, and if there is one thing a philosopher gets off on it’s abstraction.

Continue reading…

Gogol – Dead Souls [unexpected ending]

These rulers have put up their own conditions, their own values, and even their prices have now become generally known. And no ruler, though he be wiser than all legislators and rulers, has it is in his power to correct the evil however much he may curtail the activity of bad officials by putting them under the supervision of other officials. It will all be in vain until every one of us feels that as the time of the general rising up of all the peoples, he armed himself [his enemies?], so he must now rise up against injustice. As a Russian, as one tied to you by bonds of birth and blood, I now appeal to you. I appeal to those of you who have some idea of what is meant by nobility of thought. I invite you to remember the duty which every man, whatever post he may occupy, has to perform. I invite you to examine more closely your duty and the obligations of your earthly service because that is something which all of us are only dimly aware of, and we scarcely …’

[Here the manuscript breaks off]

[The following fragment turned up in an old hotel dresser in Odessa]

I have come to revise my opinion of late. It was a conversation with blind Igor that did it. Now I believe the order of the day should be boundless tyranny and absolute control.

I cannot understand how my spine grew weak. I came to identify with the common wretch. How disgusting, I recoil from those days of delirium. My own skin repels me. The sweet embrace of totalitarianism is just the ticket. “If you want a vision of the future, imagine a boot stamping on a human face – forever.” What truth those words contain! I wish I had said that.

Hacker News and Machine Learning

I recently did a search on the big G for “Hacker News” and “Machine Learning” to see which posts had attracted the most amount of search attention. I thought it might be the recent announcement of TensorFlow[0] from the aforementioned Google or the even more recent announcement of the Distributed Machine Learning Toolkit (DMLT)[1] from Microsoft. These two multinational corporations are not the only tech giants to have entered this arena. Amazon Machine Learning[2] has been in this space since April albeit they’ve taken their traditional SaaS route so while technically speaking they are providing machine learning services they don’t have an open-source toolkit offering a la Google and Microsoft. Rather, TensorFlow and DMLT follow on the heels of community offerings Torch[3] and Theano[4].

Sometimes it’s hard to spot a trend that’s right under your nose. It will be interesting to see the worlds of humanities computing and machine learning collide.

Anyway, no one posting caught my eye. What I did notice is that several companies have written about the classification of Hacker News(HN) posts. The three articles I noticed were this one about news categorizing by MonkeyLearn, this one about algorithmic tagging by Algorithmia, and this one about autotagging by Dato. There appear to be supervised and unsupervised versions of these algorithms. The supervised version matches on a predefined list of categories and training data whereas the unsupervised does not need any training data. Dato call the unsupervised approach autotagging and the approach with a training dataset simply classification. Being new to the machine learning camp I couldn’t say if these terms are standard or not. All three articles are informative, and interesting for their different take on things.

A more descriptive term than classification (which seems overly general) is topic analysis or topic modeling and this is the term I have been using in my collaboration with the originators of Saffron(Bordea, 2014). Relatedly I was looking at the introductory video for TypeScript by Anders Hejlsberg today and was struck by the applicability of the notion of type inference to topic analysis. I think we should call all these classification methods topic inference and when those topics are related one to the other then we have topic modeling, or ontology inference of one stripe or another.

I honestly couldn’t say what I’m trying to get at with this short blog post. It merely amused me that a number of machine learning shops had hit upon the same task to demonstrate their tools and wares.


[0] TensorFlow
[1] Distributed Machine Learning Toolkit
[2] Amazon Machine Learning
[3] Torch | Scientific computing for LuaJIT
[4] Welcome — Theano 0.7 documentation


Interpreting the results of Ireland’s 2015 marriage referendum

I think we go too far in calling the results tabulated the 23rd of May, 2015, as “overwhelming” or “resounding”[1]. The difference between the majority of roughly 62% and the minority of roughly 38% is about 24%. That is a mere quarter of the electorate that cast their vote. Put it another way, we would do well to remember that 734,300 people said No to equality.

The electoral constituencies[2] do not map evenly to the counties[3] of the Republic of Ireland but I have totted up some averages by giving all constituencies and parts of constituencies equal population weighting. This has led to discrepancies in the counties of Kerry, Limerick and Leitrim here. I doubt the discrepancies are large but they exist nonetheless and I will re-run the averages properly at a later date. Provisionally we’ve got the results I’ve screen-grabbed and placed at the end of this post (hint: scroll down). The spreadsheet I used is also linked to below[4].

Continue reading…