Home For Fiction – Blog

for thinking people


Programming

A JavaScript Haiku Generator with User Input

January 24, 2022

My iambic pentameter generator is among the most popular posts on Home for Fiction – and the most popular in the programming category. For a long time I’ve been meaning to make a JavaScript haiku generator as well, but I kept postponing it. Well, no more! In other words…

I thought to offer
a haiku generator
in chilly winter

And since I got into the trouble of doing all that, I thought, what the heck; let’s add user input to the mix. So, let’s see what a JavaScript haiku generator looks like.

JavaScript Haiku Generator
What would a JavaScript haiku generator be without images from Japan!
(more…)

Image to Text with TensorFlow

January 17, 2022

Machine learning is all the programming craze these days, so I thought to give it a shot myself. In all honesty, the (undoubtedly important) applications of machine learning are mostly outside my immediate interests, at least at present. But for fun, I thought to play with the intriguing TensorFlow.js library and see what I could come up with. In this post we’ll do an image-to-text with TensorFlow – a silly little program that takes an input image, detects its content, and generates some semi-random text with it.

A complete description of what machine learning and TensorFlow are is beyond the scope of this post. If you’re familiar with them, you anyway don’t need me to tell you. If you’re not but would like to find out more, feel free to read about them on the TensorFlow site (linked above) or Wikipedia.

And if you’re neither familiar nor interested in finding out more, you can still continue reading to see the results we can get. No programming knowledge required for reading; only curiosity.

image to text with tensorflow
Image to Text, TensorFlow style. This silly little program will detect what’s in this picture and generate some text from it.
(more…)

A JavaScript Demotivational Quote Generator

December 6, 2021

There’s a lot to like on the internet, and a lot to hate. To be fair, this is more of a pet peeve of mine (there are far more annoying and dangerous things out there), but I hate it still. I’m talking about those inspiring quotes, complete with images of butterflies and dramatic skies and believe-in-yourself-you-can-do-its. That’s why I thought to make this little JavaScript Demotivational Quote Generator.

I guess the reason I hate such designs is because they summarize some of the things I truly loathe, such as hypocrisy and the scourge that is simple answers to complex questions. Everything today, every experience and every instance of thought seems to be condensable into a neatly packaged, context-free sentence. It’s truly disgusting, and I mean that the same way Slavoj Žižek expertly expressed:

Click to display the embedded YouTube video

facade placeholder

And so, I decided to do something about it. It seems any idiot can pair together some fancy words and some nice images, so why not this one. The whole thing is a bit like making up a horoscope, truly. So, with these in mind, let me show you what I made.

JavaScript Demotivational Quote Generator
No JavaScript Demotivational Quote Generator is complete without cats!
(more…)