Ever since I advanced beyond the “hello worlds” of Java, I had never stopped coding. This section is for documenting code usages that I had employed while solving the technological problems that I had encountered.
To permutate a string is to change the order or arrangement of the characters that the string is made up of. Given that n is the number of characters, there are n! different ways to permutate a given string.
This post shows how we can permutate a string in Python 3.
That was day one of trying out jQuery: to add HTML components dynamically. Not a difficult task, but it will be helpful for me to record how to do DOM manipulation in jQuery for future use. As such, this post is created to recollect my experience in adding HTML components dynamically with jQuery.
Creating a search engine to search content across a polyglot website is not an easy task. In order to do that, you need to either:
take a search query and match it across data repositories from different application processes, or
have a process that will maintain an index of content from the different applications and search within that content.
Since Google had indexed most of the content in the Internet, Google Custom Search can be the easiest way for us to implement site-wide search. In addition to fast searching, Google Custom Search also comes with AdSense monetization.
In case you need it, this is how you can implement Google Custom Search as a WordPress page without using any plugin.
Since Google had indexed most of the content from my website, Google Custom Search is the easiest way for me to implement site-wide search. In addition to fast searching, Google Custom Search also comes with AdSense monetization.
Given these points and some time on hand, I had recently implemented site-wide search with Google Custom Search.
In addition to building the search page to display the search result, there is a need for a HTML search box beside the top navigation links:
Since I had spent quite a bit of time on building the search box, I decided to document the steps in this post for future references.
With this intention, this is how to make a HTML search box with the input text field and search button within the same enclosing box.
jQuery is a JavaScript library that simplify client-side scripting of HTML.
In case you want to augment your webpage with data from an API endpoint, you may want to look at jQuery.
With this purpose in mind, this post discusses how to send a HTTP GET request to an API endpoint and add the response as HTML elements to the DOM with jQuery.
One common task in the development of backend applications is the pagination of database records. Without pagination, the application server can run out of memory while generating a response from the database records.
This post discusses a way to paginate MongoEngine records in your Python 3 Flask application using the facilities provided by the Flask-MongoEngine extension.
Raspberry Pi 3 Model B boards make good gifts for programmers and if someone had gifted you with one, you may want to use it as a control center for interacting with various IoT sensors and devices at home.
In such a situation, you may want to build a Python 3 Flask application to present the web interface for accessing the control center.
After you had built that Python 3 Flask application, the next step will be to deploy it on your Raspberry Pi 3 for serving HTTP requests.
This post discusses how you can deploy a Python 3 Flask application on Raspberry Pi 3 with Raspbian Stretch Lite, Nginx, Virtualenv and Gunicorn.
With Flask and MongoEngine, development of this microsite did not take too much leisure time. With MongoDB not enforcing authentication, there were not much hindrance in setting up the development environment for this microsite.
However, this free-for-all mode of accessing MongoDB is not recommended for production environments. Without authentication, it is easier for ill-intentioned people to mess up the backend database.
To ensure that I have a go-to post for implementing authenticated access to MongoDB backed projects in the future, I document the steps needed for Flask-MongoEngine applications to access MongoDB instances with access control turned on.
Follow us