Nice “?vars” PDL feature

pdl.png

I’m starting with PDL – Perl Data Language manual, more precisely, PDL::Indexing manual, and I found a nice feature to view variables declared in current session of pdl2 interpreter: ?vars. This command is a shortcut to help vars and/or PDL->vars, it shows a report about all variables with name, data type, dimension, flow, state and memory used.

See an example:

pdl> ?vars
PDL variables in package main::

Name         Type   Dimension       Flow  State          Mem
----------------------------------------------------------------
$a           Double D [8,4,3,2,1]          P            1.50KB
$area        Double D [2,3]                VC           0.00KB
$column      Double D [1,5]                VC           0.00KB
$cube        Double D [5,5,5]              P            0.98KB
$even        Double D [5,2]                VC           0.00KB
$im          Double D [5,5]                P            0.20KB
$line        Double D [5]                  VC           0.00KB
$rgb         Double D [255,255,255]        P          126.51MB
$row         Double D [5,1]                VC           0.00KB
pdl> _

Variables with “VC” (Virtual Child) in the “State” column and “0.00KB” in “Mem” column are children of variables with “P” (Parent) in the “State” column. They share space and modifications will reflect on the parent variables and other children, if applicable.

Anúncios

Accessing Android from Emacs

Using tramp-adb is easy to access Android‘s filesystem and shell, but we still need the Android Debug Bridge (and all the Java configuration pain included…).

I didn’t know this Emacs‘s feature and started using it recently. For example, to access my old current phone, I plug it to USB port and hit into Emacs:

:,-—
😐 C-x C-f /adb:
:`-—

And the device is autocompleted.

Move, rename and delete files are fine with Dired and eshell is good as sh, but, for now, I don’t know how to inform eshell to use the device’s root instead the root of my laptop… I need to research more and make this a better workflow to tests and day tasks.