Layers and literals

There is actually a difference between phone connections and network connections. I imagined both the same, solid bold lines bent through rigid corners, each endpoint a communications device. This is true of phones and “circuit-switched” networks, but not so for packet-oriented networks like the Internet. The logical layer of “a connection” does not match the implementation.

Conceptually, packets may not travel the same route. They travel across the ebb and flow of pipes, big ones and little ones, whose marketed bandwidth is a shadow of the actual performance, the throughput. Such “layer thoughts” should not surprise me; initial assumptions ought to consider a certain implicit inaccuracy.

“It’s all software; hardware is irrelevant,” a colleague said. He looked around at his office of spare parts and sitting appliances. He wanted to learn about cylinders, databases. Software had eaten the world, and he was catching up.

Scavenged opportunity

Found a couple CCNA books. A gold mine for me, and that’s when I realized I valued the knowledge more than the cert. Having a degree is enough for me, but an entire process exists where business acknowledges a different receipt. It wouldn’t work here, I think, because the last owner left without claiming it, and left it on a back shelf with other treasures.

Hopefully I can contribute to the IT process by having a better understanding of networking. At least the suggested tools will give me some promise of automation. Expect for starters, and scripts of course. At a certain scale, people cannot be interrupts.

The first book is really nice. My mind was blown a couple times. The explanations are very good. Things are very readable, and I’m sure I can use the concepts to administer stuff at home.

Independence cusp

A simple enough form and writing to public storage, a USB driver and a small desktop app to copy over the raw data: that’s my first Android experience. The whole pipeline is almost complete; reports are next. That falls into the natural flow. The challenge is iterating everything forward, even though things are “done.”

I thought the next thing would be a scurry for a market account, a rush into the Android API, and a sudden fervor where there had been an absence. Finally, finally, I could claim an identity, a single URL for one technology, and spend days in the conjured philosophies.

But no – motivation seeped out of me again. Math was more important. Learning Unix was more important. This is the thinking of a single man, not one with family. I’m stuck again in my own zeal.

List partitions of an unmounted device

I don’t use mount often, so in between I forget how to use it. Man pages notwithstanding, I knew only enough to remember the first partition is probably a, but I received a “Device not configured” message.

> mount /dev/sd0a /mnt/cd; # wrong

You can use disklabel to show which partitions really exist on the device:

> disklabel sd0
...
c: ... unused
d: ... OpenBSD

You can look at the output of dmesg to determine if the plugged-in device is /dev/sd0, /dev/sd1, etc.

Abstracting specifics

Having to recompile gradual revisions of an email program, the stickler is the server address changed. A simple fix, to avoid hardcoding a string – an elementary avoidance, a mentally-thrown exception – asks where such an element should be placed: in a file, defined from an external script; or should the program accept parameters like general tools of its ilk, as in telnet, ping, etc.

Hardcoding the string led to a re-compile. So we define a semantic mapping, like we do when we receive ideas from others; then our definition MEANING_OF_IDEA gets a mutable value, only as constant as change dictates. But we are still trapped in a 1-for-1 correspondence between a network address and a variable.

The third level up is that we define a definitions file to store multiple such constants. Now, even when there is only a 1-to-1 mapping, we are readily prepared for 1-to-many. Uncovering this means I can no longer assume certain strict design choices that allowed me to expedite development; direct domain mappings are now perilous.

Reset forms on print in Adobe Acrobat XI

Creating a new form launches Form Center. Save the form as a PDF and Acrobat should open. Once the form appears, go to File > Save a Copy. If you don’t do this, you won’t be able to do any important Javascript. Once the copy is saved, open that copy.

With the copy open, enable Javascript menu by going to View > … A Javascript section should appear in the right Tools pane. Click on “Set Document Actions.”

Next, click on “Document Did Print” and type in this Javascript:

this.resetForm();

Software tables

I’ve placed a lot of reliance on the Excel spreadsheet. When data can be called up and later revised, pushed elsewhere – in other systems – and contributions are separate queries, Excel becomes an analysis device and VBA enables automation. That’s how I’ve been able to avoid the Java JTable, AutoIt ListView, and Tcl/Tk table.

Tables remain a presentation format, data static on arrival but dynamic from thousands of sent forms daily. You’re one or two pivots away from organizing the gestalt, and formalizing the process is straightforward. The real challenge is finding people using shared workbooks.

Here you can create a traditional application. I suppose if business requirements ask for it enough, it may be worthwhile to reinvent some portions of Excel. Not the functions, lookup or memory management, but sorting on columns, editing active cells and copy-paste (for starters).

Kid in the library

I have a “precocious child” story, but it stops early: Sierra had its adventure games and Power Rangers would come on. Go go Power Rangers~ Plus, I’d be either playing parking-lot hockey or fighting a wraith, charging up the mouse and throwing a fireball nearly the height of the screen.

I went to the library and borrowed a book on BASIC. I typed in some of the listings. My uncle helped me debug a joke program. Something about a mosquito. I never got far enough to poke at memory, and after Doom there was oblivion.

That’s what Fortran feels like for me: typing these programs in all caps, tmux in a stark xterm, typing in various inputs and writing (!) the output. Each simple READ, calculate and PRINT a step in childhood reclamation, backwards through the mists to a console with assembly, waiting for my twelve-year old self to begin:

SECTION .data

Relentless surprises

So far the pattern of scheduled task fails seems to be:

  • Run as logged in user (by default): everything works until it doesn’t. You’ll know because schtasks will show “Could not start.”
  • Run whether user is logged in or not: this will run the script, but cscript and – possibly – perl – and tclsh, maybe – may fail silently (task exits with success).
  • Run with highest privileges: cscript doesn’t seem to execute here.

That blink when you switch from the first setting to the others might be a fix: select one of the latter two and then switch back. Two blinks and things might run again. The exact kind of sorcery I hoped to avoid; possibilities include /v1 switch and prefixing /tr paths with a backslash (\).

There is also the matter of having a Desktop\ folder C:\Windows\System32\config\systemprofile. For serious!

Spaces in your echoed dates

After this, the batch script fails to find the file:

@echo off
setlocal enabledelayedexpansion

echo 2014/04/16 > dates.txt
echo 2014/04/17 >> dates.txt

for /f "tokens=*" %%i in (dates.txt) do (
  set dt=%%i
  set dtdir=!dt:/=\!
  for /f "tokens=*" %%j in (!dtdir!\data.csv) do (
    echo %%j
  )
)

endlocal
goto :eof

The batch script tries to look for files in a directory “20144\16 \data.csv”; that niggling space breaks all the difference. So to get rid of the space,

set dtdir=!dtdir: =!