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 to lead to the_file.txt. Yet now, it doesn’t.

So now, /dir0/dir3/the_file.txt is needed to access the_file.txt in dir3.

HTH:)

unix.stackexchange.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science: Perl regex: grouping with parentheses

Self-tutoring about computer science: the tutor mentions using parentheses in Perl regular expressions to form groups.

A useful feature of regular expressions is the optional use of parentheses. There are numerous reasons to use them, but one is to report parts of the match.

Consider the following:

$strng=”Hehe_12345_68d-910″;

if($strng=~m/(hehe(_[\d]+_)([\d]+d)(-[d]+))/i){

print “$1\n$2\n$3\n$4\n”;

}
else{

print “no match”;
}

The output would be (assuming no typos:)

Hehe_12345_68d-910
_12345_
68d
-910

$1 denotes the contents of the first set of parentheses in the matching pattern, $2 the second, and so on. The groupings can be used to organize the output from the match.

Source:

perldoc.perl.org

roberts perl tutorial

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Windows, Computer science: how to print the bell character in a text file

Self-tutoring about scripting: the tutor mentions a way to insert the ASCII bell.

The bell character is ASCII 7; its symbol is BEL.

Notepad++ allows BEL to be inserted in a text file: from the Edit menu, click Character Panel. An insertion panel appears at right: on it, you can double-click ASCII 7 for BEL, or whatever other ASCII character might be needed:)

Source:

superuser.com

ascii.cl/control-characters.htm

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Perl: use feature ‘say’;

More self-tutoring about Perl: the tutor mentions another way to enable ‘say’ in Perl.

In my post from Aug 15 I mention the Perl feature say and that, to enable it, a user might key

use v5.10;

below the she-bang line. (Apparently, a version past 5.10 may also suffice.)

I’ve read since that the line

use feature ‘say’;

also enables the use of say.

Source:

perldoc.perl.org

www.sthomas.net

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Using say in Perl

Tutoring computer science, new language ideas will always be noticed. The tutor mentions the Perl construct say.

use v5.10; #Apparently you need this to use say.
$var1=”Hey there:)”;
say $var1; #same effect as print “$var1\n”;

I’ve never known of say, but I tried it on a console and indeed, it works. I needed to include use v5.10; for say to work. I understand, however, that the version can be higher.

Source:

perldoc.perl.org

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

What is port forwarding?

More self-tutoring about computer networks: the tutor examines the idea of port forwarding.

From a practical point of view, port forwarding is a way to set up a router so that outside inquiries can reach a resource behind it, in the internal network.

Port forwarding relies on a two-part construct:

  1. The application the outside users want dwells on a dedicated device in the internal network;
  2. Said application is reached via a specific port on that specific device.

(See yesterday’s post for an explanation of what a port is.)

Typically, a router will block unsolicited traffic from accessing computers behind it, which is its firewall function.

Let’s imagine the application you want to enable outside users to access is reached via port x0y0 on local device D0. The port forward that will enable such access:

Router, when a request for port x0y0 arrives, send it along to D0, port x0y0.

Now, outside clients can reach that inner device D0, through the firewall and past the router, by virtue of their request for port x0y0. The setup is called port forwarding.

Source:

CCTV Camera Pros

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

What is a port in computer networking?

Self-tutoring about computer networks: the tutor offers a definition of the common networking term port.

A port can be physical or logical. A physical port is a plug-in socket at which to attach a device to the computer, such as a printer. USB ports comprise an example.

A logical port, such as port 80, designates the program a request desires to connect through. Port 80 means http activity. The logical ports on a computer are 0 to 65535.

Source:

searchnetworking.techtarget.com

SimplifiedTechExplanations

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

English, Web Design: what does deprecated mean?

Tutoring English, fresh vocabulary keeps writing interesting. The tutor brings up a term he reads in connection with computer science.

deprecated (adj)

viewed unfavourably, viewed with disapproval.

In computer science, certain ways of writing code can become deprecated after newer, preferred ways supplant them. The deprecated code may continue to be supported for a time, but after being labelled “deprecated”, it’s vulnerable to sudden dysfunction.

Source:

developer.mozilla.org

Gilmour, Lorna (ed). Collins Essential Canadian English Dictionary & Thesaurus. Glasgow: HarperCollins, 2006.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer networks: what is a switch?

More technology self-tutoring: the tutor explains his understanding of switch, a term he’s found tricky to define.

For background, my post from April 2, as well as my post from yesterday, connect with today’s topic.

Switches can be used in a variety of ways, so a simple conception only explains one application. However, I find this idea helpful:

Imagine a self-contained local network of computers physically connected. A given member can send a message to a specific other, or to all others at once. Then, the simplest central connection among these computers is a switch.

A switch is different from a hub (once again, my post from yesterday) in that the switch can forward a message to a specific intended recipient, whereas the hub just forwards it to everyone.

Source:

askleo.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Computer science, networks: what is a hub?

More technology self-tutoring: the tutor investigates the term hub in networking.

hub (in computer network):
a central device to which computers can be connected to form a local network. Data the hub receives from one computer will be forwarded to all the others to which it’s connected.

Source:

askleo.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.