Laur IVAN

Display a Function’s Errors in Oracle

Posted by in Software, Tutorial

TL;DR: Use the power of DBMS_OUTPUT.PUT_LINE, Luke! I’ve built a function along the lines of:

When using the function, I got some 0 results and I wanted to know why. The solution I got was using DBMS_OUTPUT.PUT_LINE:

Now, all you have to do is enable DBMS_OUTPUT in your environment and you’ll see the exceptions. NOTE: This is useful while building and tuning the function. IMHO one should disable the PUT_LINE statements in production. HTH, A little experiment: If you find this post and ad below useful, please check…read more

Debug Electron in VS Code

Posted by in Software

TL;DR: You need to follow the server (electron) client (VS code debugger) approach. Be aware of OS specifics! So far, my approach towards development/debugging would be to write some code, test it, rewrite, test… all with a bunch of console.log() statements. That’s not efficient at all and since VS code has debugging capabilities, I’ve decided to find out how. First, when you enter the debug mode, you’re presented with a default configuration containing of two parts: A launch part – designed to launch your application An attach part – designed…read more

Debug Javascript – Some Methods

Posted by in Software

These days I’m trying to tweak a 3rd-party framework and I’m missing stuff sometimes (e.g. injected data). Below are some methods I’ve found useful when debugging the script. console.log – print all things Object inspection – see your object’s content HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Debug Javascript – Object Inspection

Posted by in Software

Many times, you have objects where you may or may not know their content. If you’re running in the browser, life is easy as you can pause the code and inspect the object. at command line is a bit more annoying. In this case, at least for the first run, you can execute something like:

where obj is your mystery object. HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Debug Javascript – console.log

Posted by in Software

This is the holy grail of debugging for me. It’s old school, simple and effective. It works both in browser and from command line. My code looks like:

You can make it fancier with debug levels (in if() statements or with your tiny library). I however tend to add/remove them progressively as I resolve the issues. HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Intercept OkHttpClient Response for Debug

Posted by in Software

I wanted to log the data retrieved by OkHttpClient for debugging purposes. After digging for a while, the process seems quite straight-forward now. First, we create the OkHttpClient:

Then, we add an interceptor:

The interceptor code is:

The main thing to remember is that one the response has been processed, you need to create a new one and return it. HTH, A little experiment: If you find this post and ad below useful, please check the ad out :-)

Get Access to Files in Genymotion

Posted by in Software

Genymotion is a fine emulator. I’m using it as any normal user and once in a while I need to get a file from the VM to analyse (a DB file or a trace usually). Normally, the way I go is via the Device Monitor (which, in turn goes via adb). Granted, this is the universal method (read: works both on emulators and on real devices). However, it’s quite slow. So, here’s a faster way: Close your emulator Open the VirtualBox Manager. You’ll have the emulator listed there. Select the…read more