Observations on a spinning sphere

I’ve had recent cause to learn Javascript for Chrome apps, a necessity of pay. I’m working through the Chrome app tutorial on Google’s page, and the code reminds me of how I had to adapt as a programmer. In college, programming was a craft of foundations, reuse never extended past homework, and we were the builders of an optimistic, intangible future.

In the corporate world, Excel has solved many of the thoughts which I preferred to occupy, like C, memory allocations, and low-level considerations. I am using VBA well, but I try to avoid stretching the libraries to encompass more than what I’d be willing to debug: no networking, no process exec, not too many database queries. I use VBA mostly as a language to implement business rules.

Using Google’s Chrome stuff is like Excel: a company has lifted certain portions of the task in the form of idioms, and I benefit by puzzling through the varied invocations. I am wont to rebel and prefer pure Javascript, but employment is a place for results, not ideology.

Hyperlink collection limit in Excel

The idea of a file as a trace log, a semi-permanent fixture for consulting production output, can be implemented in Excel with a sheet. A hyperlink can accompany each message, directing the user to the offending row with a click. However, there is a limit to the number of links.

The hyperlinks constitute a collection, and the limit is 65,531 such links. Beyond that will throw an application error. The worst demonstration is to take new data to test and having your diagnostics fail, even when the script is otherwise sound for fifty-thousand prior rows.

But, it is worthwhile to have learned something out of it.

References

Visual Basic: File not found

No matter how careful I was – checking for running tasks before saving workbook binaries (.xlsb) – this mysterious error was fixed after moving backup copies to XLSTART. I assume the culprit was corruption or its early stages, because other macros were fine except for two. Back up your .xlsb files!

There is pressure to start pulling the module code into a source code repository, because if the .xlsb file gets corrupted enough to not open, I’m screwed.

I wonder if this is the start of runtime dependency execution, like Javascript libs loaded per page, except the subroutines are written to modules of .xlsb workbooks. It might be interesting to see if people contribute to a kind of CPAN equivalent of VBA modules, if a framework were in place.

Internet Explorer page from shortcut

AutoIt “broke” in that the former script could no longer grab the <form> tag reference when Internet Explorer was launched via a bookmark-shortcut. The workaround was to request users launch stock IE and then visit the page. It’s more clicks to initialize, so less of a win; but now I have the idea to specify a time range during which the script will not run. Thanks, blogging!

Everything is hardcoded except where a more general solution would take less (debugging) effort. Maybe I will have a framework or solid libraries later, but GUI automation feels so fragile. Building abstract works on a glass foundation seems like an eventual world of hurt.

A transition to and from

Department transfer and a new position in the cards: no increase in compensation and no new frills, but I already have of everything: a mind far cast, a bias to composition, and a reckless disregard for search terms. My only hope combines with my only fear: I will be less motivated to write code, or I will grow bored of long projects.

I’m looking forward to my new title. New hardware has been promised, but I know better. I’ll be working with someone with close to two decades of software experience, much of it low-level, so hopefully only good comes from it.

Brilliance shows early, and mathematicians might have some anxiety about it. I wonder if I’ll be writing AutoIt for the rest half of my life. Between that and Sikuli, there’s not really a GUI problem that cannot be automated. All that’s left is legacy: the cruft tacked on from generations of come-and-go workers and whispers on reliability.

I liked working on my own

We are to be consolidated under one arm, collected for the purpose of productivity, to avoid duplication of work: former solo coders, in our own nests and flying out to each hotspot, our own solutions in hand, now to cooperate under the banner of an arbitrary – or not so arbitrary – manager. The blessed cat-herder, I guess.

This is an opportunity for me to learn how to work on a team of developers. Maybe we will build bigger things and not just layers. I have been leery of libraries for the sake of not retyping snippets, because it’s shorter to pull in the lines than to remember that lib\xxx.au3 does Something Significant.

I’ve also been solving things on my own, so problems of scale are an alien concept. Most of my figuring puts a solid pulse on the heart of the necessary mechanics; Google fills in the rest. To imagine the bound of the celestial with more keyboarders is, at the moment, literally incomprehensible.

pdftk and xpdf frontend

You can combine pdftk’s burst feature to split a PDF file into individual pages, and then xpdf’s pdftotext.exe tool to peruse each file for naming hints. For example, naming each PDF by its tracking number:

for /f "tokens=*" %%i in ('dir /B /O:N pg_*.pdf') do (
  pdftotext.exe %%i current.txt
  for /f "tokens=3" %%j in ('findstr /C:"track" current.txt') do (
    move %%i %%j.pdf
  )
)

Combine with AutoIt to create a useful frontend for users. Use RunWait() and @ScriptDir to help you execute from a bin\ directory containing these tools.

Sikuli on a USB flash drive

I will wander in the path of ghosts: past folks whose skill transmits by oral reverence: “He plugged in a USB flash drive and made it happen.” So I gave Sikuli another go; here is how to configure it:

  • Copy over the Java JRE from your local machine to the flash drive.
  • Copy over the extracted Sikuli directory to the flash drive.
  • Create a batch script on the flash drive.
  • Follow the hints in the FAQ

I did not use python, so I skipped that option. You can put the batch script in the same folder as the JRE folder and the Sikuli folder, and the variables can be set as you wish.

In the batch script, use run-IDE.cmd; this lets you test and debug on the target machine – useful when resolution is different between your laptop and the user’s desktop. (Sikuli fails easily with images.) Specifying the -r flag lets you run the target .sikuli folder, which you can execute from AutoIt with TimerInit() and TimerDiff().

The proc’s performance

How many customers the restaurant can handle at the same time is called its bandwidth. How quickly each one can be served is called its latency. The number of customers per hour that the restaurant can handle is its throughput. These quantities — bandwidth, latency, throughput — are common measures of program performance.

– “Interactive Programming in Java”

Key metrics collected into a chunk of paragraph, ready for your consumption. Is it perfectly correct; slightly inaccurate; completely wrong? I read that the process of “deep learning” involves “unlearning.”