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.
I had decided to include node.js into my toolbox. In the process of getting myself acquainted with node.js, I had jotted down some key points for myself for developing node.js applications in the future. This posts list those key points, and I will update the list as and when I learn more about this useful tool.
There are times when we want to push a dynamically generated file to our users based on their inputs. That file could be an excel file that holds payment transaction reports for a time period or a tabulation of guest names who had accepted invitations to our corporate house warming.
In such cases, the user should be presented with a dialog box which lets him decide whether to save it somewhere in her local filesystem or open the file for viewing with an appropriate application in his computer.
For example, in my tool for generating boilerplate coding from a list of country names, I am presented with some input fields where I can submit some instructions to format the output of the boilerplate coding. And upon clicking on the “Generate” button, I am shown a dialog box that looks like the following:
Let’s cook up a simple scenario to demonstrate this idea with jQuery.
Suppose we are creating a simple game for the user to draw a random number. For this, we have a text field for the user to write his name. There will be a number dial that changes at random. When the user clicks on the “Get lucky number” button, the browser will present a text file for the user to download.
The text file will contain the user’s name and the number taken from the number dial at the instance when he clicks on the button.
I was rather new to a system with hundreds of Oracle database tables. There was once when I realized that I had to delete a redundant row from the SYSTEMS_CONFIGURATION table.
As there are foreign key references to the SYSTEMS_CONFIGURATION table, I had to first remove all foreign key references to the redundant SYSTEMS_CONFIGURATION table row prior to deleting it.
This post captures the SQL query which I had ran on my Oracle database to find all the tables which had foreign key references to SYSTEMS_CONFIGURATION table, so that I can write the SQL update statements to delete all child references to the redundant SYSTEMS_CONFIGURATION row prior to deleting it.
Sometimes, instead of showing a dialog box within a web page, it is more strategic to spawn a new HTML window as a dialog box to capture user input. This technique is especially useful when there are Java applets embedded in the web page, as Java applets tends to appear in front of every visual element on a HTML web page. There is no easy solution to place a visual element, for instance a HTML div, on top of Java applets.
Spawning another web page in another window is straightforward, but how do I send data collected from a child HTML window back to the parent HTML webpage? With this question in mind, I set out to find an answer.
There came a time where I had to create a HTML form to accept inputs from users in order to generate a report. Before submitting the form to the back end server, there are some validations that I can perform on the data at the client side to reduce the number of HTTP responses that my server had to generate for unwanted inputs. The cost savings is especially significant when the form submission contains large file as part of the HTTP request.
I chose to use jQuery for intercepting the form submissions and do some data validation before I allow the browser to create a HTTP request to the server. This post documents a proof of concept, as a stepping stone, to realize my objective.
I was exploring on how to create drag and drop elements on a webpage. The first thing that I have to know is to detect my mouse cursor coordinates when my mouse moves.
This post documents my exploration in using jQuery to detect mouse cursor coordinates when I move my mouse.
Follow us