Closure Functions

Posted on Fri 21 May 2021 in Programming • Tagged with first-class functions, python, luajit, javascript • 1 min read

Closure are higher-order functions which return lower-order function (usually first-order function) with its environment. Defining closure functions is possible in languages which has first-class functions like Python, JavaScript, Lua, Scheme, and others.

Example

1
2
3
4
5
6
def divisiblity_check(divisor):
    """Factory for producing functions that check divisiblity with …

Continue reading

First Class Functions

Posted on Thu 20 May 2021 in Programming • Tagged with first-class functions, python, luajit, javascript • 1 min read

In most programming languages, type, object, entity, or value is considered first-class object and hence can be returned from a function, modified or assigned to a variable. If a programming language considers functions as first-class object, then the programming language is said to have first-class functions. Hence, in such programming …


Continue reading

Mounting qcow2 drive

Posted on Sun 31 January 2021 in Software • 1 min read

The qcow2 (or QEMU copy-on-write) is a virtual disk image format primarly used by QEMU for guest systems. In many circustances, such as reseting passwords, editting or recovering files etc., mouting a qcow2 disk images without running a guest system is required. This can be acheived by Network Block Device …


Continue reading

Windows 10 guest on QEMU

Posted on Fri 22 January 2021 in Virtual Machine • 2 min read

I use Linux (Debian) as my daily driver. However, for some softwares only available on the Windows platform, I use Windows 10 VM in QEMU (managed using virt-manager). There is a myth about the Windows 10 guest under QEMU that they are slow compared to other virtualization techniques/softwares (VirtualBox …


Continue reading

Access data in lvm2 drive

Posted on Sun 10 January 2021 in Software • 1 min read

Prerequisite: The system should have lvm2 installed. On debian this can be achieved by sudo apt install lvm2.

For mounting a lvm2 drive, we need to activate the associated LVM group. The following command can list all available LVM group:

1
sudo vgscan

Scanning will show the name of different …


Continue reading