Posts

Showing posts from October, 2018

Acting when the user pastes an image

Image
I recently saw a question about how to act when someone paste's an image (from clipboard data). There is a plugin that can handle that - to store the image into a table, but I was interested from a purely academic perspective how this would work without using the plugin. So, taking a look on MDN, I can see that there is a 'paste' event that you can listen to. See the documentation here: https://developer.mozilla.org/en-US/docs/Web/Events/paste . Ok, so lets give this a whirl! I'm not going to cover loading this into a table/BLOB column, as it's been covered before. What we'll do, is create a region with an image element this will show our image as we paste - this can easily be extended to load it into a canvas, load into a table, whatever your hearts content! Firstly, the region to show what the user pastes: Next, we need a dynamic action. This will be a custom event ("paste") with the selector being the body. Our True Action will be &q

SQL*Plus, Node and Docker

Image
This post is a continuation of my post from earlier in the week, in which I showed how to set up SQL*Plus, through a docker container that Oracle provides in their container registry. In that post, I set up the sqlplus command through an alias. Almost all examples I've seen in the past use an alias when setting up a command line program that is in effect a docker container. However, I have an extension in VSCode that I use that compiles my code which in effect is calling sqlplus and running my script. Even though I was able to connect in gnome-terminal and use SQL*Plus effectively, in my extension, no output was coming through. My code looked like this: var ChildProcess = require('child_process');   var sqlplusArgs = ["vmtest/vmtest@//192.168.0.104", "@test.sql"]; var sqlplusProcess = ChildProcess.spawn("sqlplus", sqlplusArgs); sqlplusProcess.stdout.on('data', (data) => { console.log( data.toString() ); }); The fir