View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

What makes a good string hashing algorithm? In general, it depends on what type of contents are typically in your strings, but for short strings of words in natural language, we can look toward an interesting psychological observation to help simplify the challenge. If you take a passage of English text, and for each word, you scramble up the letters in between the word, but keep the first and the last letter the same, many people will be able to read the passage just fine. Essentially, the simplifying observation here is that words are disassembled into data structures where by only the first character, the last character, and the length of the data structure is stored precisely, and all letters in between are simply treated as an unordered set. This means you can define your programming language word hashing data structure as follows:

struct WordHash_tag
{
  char first;
  char last;
  unsigned char length;
  /* Bit mask of which alphabet letters appear in the word.
     Essentially, uppercase, lowercase, and special characters are
     modulo wrap-around folded into the same numeric space.  */
  unsigned long letters;
};
typedef struct WordHash_tag WordHash;

Read on →

Recently, I’ve got started with writing some Jenkins pipeline code. Groovy, eh? Yep, definitely Groovy. So here I go a-searching for information on Groovy, and here are some of my notes on the things I needed to use.

Use findFiles() in Jenkins to get a list of files in the indicated directory, matching the given regular expression. Please note that directories cannot be matched and returned in the file list, only regular files.

20190531/DuckDuckGo jenkins findFiles
20190531/https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps/
20190531/Google Jenkins findFiles does not list directories
20190531/https://groups.google.com/forum/#!topic/jenkinsci-users/VW_5fiq-6tU

findFiles returns a list of FileWrapper objects, which you must parse and process to convert into a list of filename strings.

20190531/Google javadoc FileWrapper
20190531/https://javadoc.jenkins.io/plugin/pipeline-utility-steps/org/jenkinsci/plugins/pipeline/utility/steps/fs/FileWrapper.html

Use for-each syntax in Groovy like this:

def result = []
def wrap = findFiles(glob: '*')
wrap.each { it, i // iterator, index
  def full_path = it.getPath()
  result.add(full_path)
}

Read on →

So, recently, I had the ordeal of setting up Git for Windows, Rsync on Windows, and Ruby on Windows on a Windows 10 computer. Why? Obviously, if you know me, this was not for my own agenda, so clearly it was because I was doing work on someone else’s behalf, and due mainly in part to corporate bureaucracy in IT device management and the relative costs of the different supported IT device configurations, this is what happened to be supported and selected for me. Macs were available, but too expensive for a contractor, so okay, we’re going with a Windows computer, and heck no Linux-based standard corporate system configuration is supported here, unfortunately.

So, I’m playing along with this system setup. Okay, sure, this problem again. We have these Unix developers who are dispassionate about supporting Windows, so they just slop together a ton of Unix dependencies ported to Windows in some poster-titled software package with the intent of only getting that one software package working, to the ignorance of all others included within. But, I’m thinking. Gosh, if Git for Windows includes MSYS within it, and I need Rsync too, why can’t I just do an install of Rsync inside that Git for Windows MSYS environment? Well, well, that is where you run amok onto territorial wars and some very heavy code-writing but not very collaborative developer working on Git for Windows, who by the way is employed by Microsoft.

Read on →

Is it possible to connect a classic Macintosh to the Windows SMB network? Yes, but keep in mind the particular vintages of Macintosh under which this is possible. Obviously, support is skewed toward 1990s-era Macintoshes, typically those with the PowerPC processors, CD-ROM drives, color monitors, and so on. Connecting a black and white Macintosh to the Windows network may be much more tough luck.

20190527/DuckDuckGo macintosh classic samba shares
20190527/DuckDuckGo macintosh classic windows netbios cifs
20190527/https://happymacs.wordpress.com/2014/06/16/network-you-classic-mac-with-windows-part-1-using-dave/

So, I’m wondering. Really, I thought for sure I saw some software to copy a disk image of a Macintosh hard drive, but I was initially dismayed that it required copying over Ethernet. Now that I’m thinking again that I will be able to have TCP/IP networking set up over a PPP serial connection, maybe it’s not so bad after all. Alas, I cannot seem to quite find that software. On the other hand, with some more thought and searching on the subject, I came up with a viable alternative.

Follow the trail of links to get to the jackpot.

20190527/DuckDuckGo macintosh classic copy hard drive over network
20190527/DuckDuckGo disk copy 4.2
20190527/DuckDuckGo https://macgui.com/downloads/?file_id=23405
20190527/https://www.macintoshrepository.org/2416-diskcopy-4-2-6-0-6-3-3-6-4-6-5b13
20190527/https://www.macintoshrepository.org/266-shrinkwrap-3-5-1
20190527/https://www.macintoshrepository.org/219-copy-ii-mac-6-3
20190527/https://www.macintoshrepository.org/1285-diskdup-pro

Copy II Mac is the name of the software. So there is already some good old software that works on black and white Macintoshes for copying the contents of one hard drive to another. We’ll get back to that thought after the next research article.

This is an interesting and useful article.

20190527/http://georgeharito.com/2014/05/scsi2sd-on-my-se30/

Read on →

So, you have a bare metal classic Macintosh, but no software for it? How do you get software over to it? How do you get it to even boot? Here, I will unravel my advice that I have developed over the years of working with and researching classic Macintosh software.

  1. You need a system disk to boot. To get a system disk for your Macintosh, you must ascertain the particular hardware vintage of it to determine compatibility. There are a few main lines of Macintosh compatibility here.

    • “Old world” Macintoshes:
      • 400K floppy disk drive Macintoshes
      • 800K floppy disk drive Macintoshes
      • 1.44 MB floppy disk Macintoshes
      • Macintosh Classic includes system disk image in ROM
      • Macintoshes equipped with bootable CD-ROM drives
    • “New world” Macs:
      • OpenFirmware PowerPC Macs.
      • EFI PowerPC Macs.
      • EFI Intel Macs.

Read on →

Compile-time hashes

2019-05-26

Categories: unlipic   tour-de-force  
Tags: unlipic   tour-de-force  

I happened to be reviewing some code that I’ve wrote a while earlier. At the time I was writing it, I thought I “just shoved some stuff together,” but on second thought and further analysis, I realized I had some pretty good ideas going on there.

So, what exactly was happening in my code? Basically, I had written a simple application that needed a very simple way to store key-value data in a plain text file. So, naturally, I settled on the technique that is referred to as some as Unix conf-style or delimiter-separated values: this is a text file with one field per line, the key name of the field is the text from the beginning of the line to the first colon, and the value is everything else after the first colon until the newline character at the end of the line. Example:

one:two
three:four
five:six

Read on →

One thing about finance nowadays is that we have a lot of tools and technologies for finance, but one fact that sometimes tends to be lost in the complexity of the modern world is that everything is still based off of olf fashioned bartering and trade. So, let’s take a look one personal financial technology stack t hat is fairly common nowadays.

  1. At the very base of economics is bartering, bargaining, and trade: the idea that you can exchange two different, incompatible goods and services as if they were of the same value.

  2. As an abstraction of the direct trade of goods and services, goods and services can be exchanged for a quantity of a single type of objects, and these abstract objects can then be exchanged again in other trade transactions. This facilitates a large range of trading options with the new abstract intermediate quantity.

    The most pure form of “a single type of objects” is a single, pure element, of which the easiest to obtain is a non-reactive pure metal such as silver or gold. The exact quantity of this element can then be easily and empirically determined by means of its weight.

  3. As an abstraction of the weight of a pure elemental metal, metal coins can be symbolically assigned arbitrary monetary values regardless of their physical weight.

Read on →

So, you want to create a hard disk image of a really old Macintosh, but you are having trouble finding the software? Well, from the looks of it, maybe you simply will never find some already written software for this particular use case. Back in the day, the vast majority of Macintosh users transferred data by copying files between floppy disks. The more Unix-like methodology of doing a dd and sending the result over the network is a foreign one to Macintosh users, especially among old world Macintosh computers.

So, on we go with the search. Surprise surprise, if you know where to look, you can find a treasure trove of documentation on the disk interface.

20190525/DuckDuckGo inside macintosh scsi disk driver
20190525/http://www.fenestrated.net/mirrors/Apple%20Technotes%20%28As%20of%202002%29/tn/tn1189.html

Inside Macintosh was purportedly all on the Internet, but you’re going to need the Internet Archive Wayback Machine in order to see it. As was typically the case in recent years, Apple has been deleting all Macintosh Classic information from their website.

20190525/https://web.archive.org/web/20000306231850/http://developer.apple.com/techpubs/mac/Devices/Devices-122.html
20190525/https://web.archive.org/web/20000229231834/http://developer.apple.com/techpubs/macos8/mac8.html
20190525/https://web.archive.org/web/20000414113920/http://developer.apple.com/techpubs/mac/Devices/Devices-2.html

Read on →

I only take nature telephoto-style photos every once and a while with my DSL camera. However, since I am deliberately going light on my camera gear to maximize the economy of it relative to the quality of the typical photos I take, this necessarily means that I end up using my 50 mm prime lens and crop down photos to get the effect of photographing wildlife with a telephoto lens.

So, now comes down the question. Were I to go and buy a better lens, what should I go with?

The 500 mm lenses appear to be unweildly, though they would be nice, of course. The Pentax 200 mm lens is pretty nice, light, and compact, the quality is good, but the maximum aperture is f/4. There is also a nice 135 mm Pentax lens with f/2.5 aperture. This one is apparently pretty good for portrait photography, and some would recommend it rather than the 200 mm for basic wildlife photography too. 300 mm? Well, looks like it is not really worth it in terms of value.

Which is preferred, long focal length lenses or telephoto lenses? According to the source referenced by Wikipedia, there really isn’t much difference between the two, the telephoto lenses are simply shorter. Check your lens quality charts and see if you can find something you like.

A teleconverter is a lens accessory that you use to magify the image, at the expense of photographic quality and optical resolution.

For wildlife photography, a “blind” refers to a cover that you place over yourself to conceal yourself from wildlife.

20190521/DuckDuckGo pentax k 200 mm tele
20190521/https://www.pentaxforums.com/lensreviews/SMC-Pentax-M-200mm-F4-Lens.html?page=2
20190521/DuckDuckGo wildlife use a blind
20190521/https://photonaturalist.com/use-photographic-blind/
20190521/DuckDuckGo pentax 135 mm f2
20190521/https://www.pentaxforums.com/lensreviews/SMC-Pentax-K-135mm-F2.5-Lens.html
20190521/DuckDuckGo pentax k 500 mm
20190521/https://www.pentaxforums.com/lensreviews/SMC-Pentax-K-500mm-F4.5-Lens.html
20190521/DuckDuckGo pentax 300 mm
20190521/https://www.pentaxforums.com/lensreviews/SMC-Pentax-K-300mm-F4-Lens.html
20190521/DuckDuckGo tips tele photo lenses
20190521/https://digital-photography-school.com/10-tips-for-great-telephoto-photography/
20190521/DuckDuckGo teleconverter
20190521/https://en.wikipedia.org/wiki/Teleconverter
20190521/https://en.wikipedia.org/wiki/Telephoto_lens
20190521/https://www.shutterbug.com/content/telephoto-lenses-view-camerasbrthe-long-and-short-it
20190521/DuckDuckGo long focal length versus telephoto lens
20190521/https://en.wikipedia.org/wiki/Long-focus_lens
20190521/https://www.borrowlenses.com/blog/what-is-a-telephoto-lens/