Category: computer science

Webpack: how to get installed version

Self-tutoring about computer science: the tutor mentions a way to find the installed version of webpack. npm list webpack is the way I’ve found works. I run Webpack in Node on Windows. Source: stackoverflow.com

Perl: ternary operator

Perl self-tutoring: the tutor mentions the ternary operator. Let’s imagine the variable $v0 is not defined, and therefore false from Perl’s point of view. $v0 ? print ‘defined’ : print ‘not defined’ will output not defined. a?b:c is known as

Perl: map

Tutoring Perl: the tutor gives an example of Perl’s fantastic map function. Suppose you have the array (1,2,3,4), but you want to musically enhance it to (and a 1, and a 2,….) @arr=map {‘and a ‘.$_} (1,2,3,4); yields @arr =

Computer science: PHP: the register_globals phenomenon

Self-tutoring about PHP: the tutor looks into the hazard of register_globals. In PHP, register_globals, when set to 1 (or on), could allow variables to be created and set from within web requests. In particular, if a variable was uninitialized in

Perl: greedy vs lazy match

Perl tutoring: the tutor compares a greedy match with its corresponding lazy one. argument greedy lazy e2ee9a /e\w*\d/ /e\w*?\d/ match e2ee9 e2 Source: roberts perl tutorial McGrath, Mike. Perl in easy steps. Southam: Computer Step, 2004.

Computer science: regular expressions w/ Perl

Perl tutoring: the tutor comments about square brackets in Perl regex. Perl regex match string /[beat24]/ string containing any of b,e,a,t,2,or 4. /beat24/ string containing the exact sequence beat24 Source: McGrath, Mike. Perl in easy steps. Southam: Computer Step, 2004.

Computer science: what does REPL mean?

Self-tutoring about computer science: the tutor comments about an abbreviation he read. REPL: read-evaluate-print-loop As I understand, REPL denotes the context in which a user keys a command into a terminal, the computer evaluates the command, then it prints its

Computer science: blocking vs non-blocking input/output

Self-tutoring about computer science: the tutor mentions the concepts of blocking and non-blocking i/o. mode effect blocking program waits for external process that it calls non-blocking program continues past external process call, possibly even finishing before it receives response from

Computer science: shallow copy vs deep copy

Self-tutoring about computer science: the tutor mentions the difference between shallow and deep copy. A shallow copy of an object is a new name for it. When the original changes, so will the shallow copy. Moreover, a change to the

Computer science: when a relative path stops working

Self-tutoring about computer science: the tutor shares a recent discovery. I’ve been using a directory structure in a new context that doesn’t seem to recognize relative paths. For instance, let’s imagine the directory structure From dir3, the link ./the_file.txt used

Top