From e44ef39a735394150e6d909d129bf5d0d70fcd21 Mon Sep 17 00:00:00 2001 From: log Date: Tue, 29 Nov 2022 12:16:31 +0100 Subject: [PATCH] new repository write here write now --- .ipynb_checkpoints/babel-checkpoint.txt | 112 +++++++++++++++++ .ipynb_checkpoints/define-this-checkpoint.py | 88 ++++++++++++++ .ipynb_checkpoints/definitions-checkpoint.csv | 1 + .ipynb_checkpoints/getch-test-checkpoint.py | 14 +++ .ipynb_checkpoints/keyboard-in-checkpoint.py | 40 ++++++ .../keyboard-in-getch-checkpoint.py | 47 +++++++ .ipynb_checkpoints/the-record-checkpoint.txt | 1 + 20221122-define-this.py | 115 ++++++++++++++++++ __pycache__/getch.cpython-39.pyc | Bin 0 -> 244 bytes babel.txt | 112 +++++++++++++++++ define-this.py | 88 ++++++++++++++ definitions.csv | 30 +++++ getch-test.py | 14 +++ keyboard-in-getch.py | 47 +++++++ keyboard-in.py | 40 ++++++ the-record.txt | 29 +++++ ttyUSB0 | 1 + 17 files changed, 779 insertions(+) create mode 100644 .ipynb_checkpoints/babel-checkpoint.txt create mode 100644 .ipynb_checkpoints/define-this-checkpoint.py create mode 100644 .ipynb_checkpoints/definitions-checkpoint.csv create mode 100644 .ipynb_checkpoints/getch-test-checkpoint.py create mode 100644 .ipynb_checkpoints/keyboard-in-checkpoint.py create mode 100644 .ipynb_checkpoints/keyboard-in-getch-checkpoint.py create mode 100644 .ipynb_checkpoints/the-record-checkpoint.txt create mode 100644 20221122-define-this.py create mode 100644 __pycache__/getch.cpython-39.pyc create mode 100644 babel.txt create mode 100644 define-this.py create mode 100644 definitions.csv create mode 100644 getch-test.py create mode 100644 keyboard-in-getch.py create mode 100644 keyboard-in.py create mode 100644 the-record.txt create mode 100644 ttyUSB0 diff --git a/.ipynb_checkpoints/babel-checkpoint.txt b/.ipynb_checkpoints/babel-checkpoint.txt new file mode 100644 index 0000000..8c02cb3 --- /dev/null +++ b/.ipynb_checkpoints/babel-checkpoint.txt @@ -0,0 +1,112 @@ +The world (which some call the Library) is made up of an unknown, or perhaps unlimited, number of hexagonal galleries, each with a vast central ventilation shaft surrounded by a low railing. +From any given hexagon, the higher and lower galleries can be seen stretching away interminably. +The layout of every floor is identical. +Twenty-five long shelves, five on each side, fill all the sides but one; the height of the shelves, which is the height of the walls, is little more than that of the average librarian. +From the unshelved side, a narrow passageway leads off to another gallery, which is identical to the first and to all the others. +To left and right of the passageway are a pair of tiny cupboards. +One is used for sleeping upright; the other, for satisfying faecal necessities. +From this passage a spiral stairway climbs up, or goes down, to the uttermost reaches. +The passageway contains a mirror, which faithfully duplicates what appears before it. +From this, most people infer that the Library is not infinite, for, if it were, why this illusion of duplication? I prefer to imagine that the mirror’s gleaming surface depicts and promises infinity. +Illumination comes from spherical fruit called lamps. +There are two, opposite each other, in each hexagon. +Their light is inadequate, though continuous. +Like all men in the Library, in my youth I travelled, roaming in search of a book, perhaps of a catalogue of catalogues. +Now, when my eyes can barely make out what I write, I am getting ready to die a league or two from the hexagon where I was born. +Once I am dead, there will be no want of pious hands to hurl me over the railing. +My grave will be the bottomless air; my body will plummet for a long, long time, decaying and dissolving in the wind generated by my fall, which will be infinite. +I have said that the Library is limitless. +Idealists argue that hexagonal chambers are the quintessential form of absolute space or, at least, of our perception of space. +A triangular or five-sided chamber, they reason, is unimaginable. +(Mystics claim that their ecstasies reveal a circular chamber with a great circular book, whose continuous spine runs all the way round the walls, but the evidence of these seers is suspect and their words obscure. +Such a cyclical book is God.) For now, I need only quote the classic dictum that ‘The Library is a sphere whose exact centre is any hexagon and whose circumference is beyond reach.’ Each wall but one of each hexagon has five shelves; each shelf holds thirty-two books of a uniform size. +Each book contains four hundred and ten pages; each page, forty lines; each line, eighty characters in black letter. +There are also characters on the spine of each book but they give no indication or forewarning of what is inside. +I know that this discrepancy was once looked on as a mystery. +Before I run through the explanation (whose discovery, despite its tragic ramifications, may be the most important event in history), let me call to mind a few salient facts. +First, that the Library has always existed. +Of this truth, whose direct corollary is that the world will always exist, no reasonable mind can be in doubt. +Man, the imperfect librarian, may be a creation of chance or of evil lesser deities. +The world, with its elegant supply of bookshelves, of baffling volumes, of inexhaustible stairways for the traveller and privies for the seated librarian, can only be the creation of a god. +To appreciate the distance between the divine and the human, all we need do is compare the crude, spidery symbols my fallible hand is scrawling on the endpapers of this book with the organic letters on the inside, which are precise, fine, deep black, and perfectly symmetrical. +Second, that the number of these symbols is twenty- five.* The discovery of this fact three hundred years ago led to the formulation of a general theory of the Library and to a satisfactory solution of a problem which, until then, no hypothesis had addressed - namely, the formless and random nature of almost all books. +One, once seen by my father in a hexagon of Circuit 1594, consisted of a relentless repetition, from beginning to end, of the letters M C V. +Another, frequently consulted in this zone, is nothing more than a labyrinth of letters but its second-to-last page reads, ‘O time your pyramids.’ We now know that for every coherent or straightforward line there are leagues of nonsensical, clashing sounds, verbal hodgepodge, and gibberish. +(I know of a wild hinterland whose librarians reject the superstitious and pointless custom of looking for meaning in books, which they equate with seeking meaning in dreams or in the haphazard lines of one’s hand. +They admit that the inventors of writing imitated the twenty- five natural symbols, but they maintain that their use is accidental and that books in themselves mean nothing. +This notion, as we shall see, is not entirely false.) For a long time it was believed that these impenetrable books were works in dead or remote languages. +It is true that earliest man, the first librarians, used a language very different from the one we speak now; it is true that some miles to our right the language spoken is a dialect and that ninety floors above us that dialect is incomprehensible. +All this, I repeat, is true, but four hundred and ten pages of unbroken lines of M C V can be part of no language, however primitive or however much of a dialect it may be. +Some people suggested that each letter might have a bearing on the one after it and that the meaning of M C V in the third line of page 71 was not the same as that of these letters in another position on another page, but this embryonic theory came to nothing. +Others believed that these letter sequences were codes, a hypothesis that has been widely accepted, although not in the sense intended by its originators. +Five hundred years ago, the head of an upper hexagon* came across a book as confused as the rest but which had almost two pages of identical lines. +He showed his find to a peripatetic cryptographer, who told him they were in Portuguese. +Others said they were Yiddish. +Within a hundred years, the language had been established as a Samoyed- Lithuanian dialect of Guarani, with inflections from classical Arabic. +The contents, which were also decoded, proved to be theories of synthetic analysis, illustrated by endlessly repeated examples of variations. +Such examples led one librarian of genius to stumble on the Library’s fundamental law. +This thinker noted that all the books, however different they may be, have identical elements - the space, the full stop, the comma, and the twenty-two letters of the alphabet. +He also claimed something that all travellers have confirmed - that in the whole vast Library no two books are the same. +From these undeniable premises he deduced that the Library is complete and that its shelves hold all possible permutations of the twenty-odd symbols (a number which, although vast, is not infinite) or, in effect, everything that can be expressed in all languages - a history of the future down to the last detail, the autobiographies of the archangels, a true catalogue of the Library, thousands and thousands of false ones, a proof of the falseness of these catalogues, a proof of the falseness of the true catalogue, the Gnostic gospel of Basilides, a commentary on this gospel, a commentary on the commentary on this gospel, a true account of your death, translations of each book into all languages, interpolations from each book into every other book. +When it was announced that the Library was the repository of all books, the initial response was one of unrestrained joy. +Men everywhere felt they were lords of a secret and still intact treasure. +There was no individual or world problem for which an eloquent solution did not exist in some hexagon. +The universe had been justified and at a stroke had usurped the limitless dimensions of hope. +At the time, there was much talk of the Vindications - books of apologia and prophecy, which justified for ever the actions of each man on earth and held wondrous mysteries concerning his future. +Thousands of avid seekers abandoned their comfortable native hexagons and rushed upstairs and down, driven by a fruitless urge to find their particular Vindication. +These pilgrims wrangled in the narrow passageways, uttering dark curses and seizing each other by the throat on the divine stairways; they flung the deceiving books into the bottomless pit of the shafts and were hurled to their deaths by men from distant regions. +Others went mad. +The Vindications exist (I have seen two that tell of people in the future, who may not be imaginary), but the seekers forgot that the likelihood of a man’s finding his own apologia - or some false version of it - is next to nil. +It was also hoped at that period that the fundamental mysteries of human life - the origin of the Library and of time - would be revealed. +Clearly, these deep mysteries can be explained in words, and, should the language of philosophers be inadequate, the multiform Library will doubtless have produced the undiscovered language that is required, together with its vocabulary and grammar. +For four hundred years, men have been exhausting the hexagons. +There are official searchers, or inquisitors. +I have seen them in the performance of their work. +They always arrive bone weary, talking about a stairway with missing steps, which was nearly the death of them. +They talk to the librarian about galleries and staircases. +Sometimes they pick out the nearest book and leaf through it in search of shameful words. +Plainly, none of them expects to find anything. +Of course, the excessive hope was followed by extreme depression. +The conviction that some shelf in some hexagon held precious books and that these precious books were inaccessible seemed almost too much to bear. +A blasphemous sect suggested that the searches stop and that everyone keep scrambling and re-scrambling the letters and symbols until, through an improbable stroke of luck, the canonical books emerged. +The authorities felt obliged to lay down strict rules. +The sect disappeared, but in my childhood I saw old men who for long periods hid in the privies, with some metal disks in a forbidden shaker, trying feebly to ape the divine disorder. +Others, conversely, believed that the most important thing was to eliminate useless works. +These men, showing credentials that were not always false, invaded the hexagons, pored over a single volume and condemned whole shelves. +To their ascetic zeal for cleansing we owe the senseless loss of millions of books. +The names of these perpetrators are still cursed, but those who mourn the ‘treasures’ destroyed in such frenzy overlook two wellknown facts. +One, that the Library is so vast that any loss caused by humans is necessarily minute. +The other, that each copy is unique, irreplaceable, but since the Library is a totality there are always several hundred thousand imperfect copies - works that differ in no other detail than a letter or a comma. +Contrary to general opinion, I take the view that the damage caused by the Purifiers’ raids has been exaggerated as a result of the terror these fanatics unleashed. +A madness drove them to defeat the books of the Crimson Hexagon - books of a smaller than average size, which were all-powerful, illustrated, and magical. +We also know of another superstition of that time - that of the Man of the Book. +On some shelf in some hexagon, it was said, there must be a book that is the sum and substance of all the others. +A certain librarian has studied it and he is akin to a god. +In the language of this particular zone, traces of the worship of this long-dead official remain. +Many have made pilgrimages in search of Him. +For a hundred years, they vainly exhausted every possible path. +How were they to discover the venerated secret hexagon that gave Him shelter? Someone suggested that they should try working backwards. +To find book A, first consult book B, which will tell where A is; to find book B, first consult book C, and so on ad infinitum. +I have squandered and used up my years in quests of this kind. +It seems to me quite possible that on some shelf or other in the world there may be an all-embracing book.* I pray the unknown gods that one man - just one, even if thousands of years ago - has examined and read it. +If honour and wisdom and happiness are not my lot, may they be the lot of others. +May heaven exist, even if my place is in hell. +Let me be reviled and obliterated, so long as for a single instant - in a single being - Your vast Library finds justification. +Unbelievers insist that in the Library nonsense is the norm, while reason (or even simple, lowly coherence) is an almost miraculous exception. +I know they speak of ‘the feverish Library, any one of whose haphazard volumes runs the endless risk of turning into any other and that all books affirm, deny, or cast confusion on this fact like a god in a state of delirium’. +These words, which not only denounce but also exemplify chaos, are a clear proof of bad taste and hopeless ignorance. +In fact, the Library includes every verbal structure and every permutation that the twenty-five symbols permit but not a single piece of sheer nonsense. +It is of no purpose to point out that the best book in the many hexagons I administrate is entitled Combed Thunder, and another The Plaster Cramp, and a third Axaxaxas Mlö. +These titles, although at first sight meaningless, must lend themselves to some coded or allegorical interpretation. +Such an interpretation consists of words and so, by definition, is in the Library. +I can make no combination of letters - even dhcmrlchtdj - which the divine library has not envisaged and that in one or another of its secret languages does not hold some fearful meaning. +Any syllable full of tenderness or fear uttered in any one of those languages is the all-powerful name of a god. +To speak is to fall into tautology. +The present futile, long-winded epistle already exists in one of the thirty-two volumes of the five shelves in one of the numberless hexagons - as does its refutation. +(An n number of possible languages use the same vocabulary; in some, the symbol for ‘library’ correctly denotes ‘a ubiquitous, ever-lasting system of hexagonal galleries’, but in others ‘library’ is ‘bread’ or ‘pyramid’ or anything else, and the seven words that define it have another meaning. +Are you sure, you who are reading this, that you understand my language?) The act of writing methodically distracts me from the current condition of mankind. +The certainty that everything is already written negates or makes phantoms of us. +I know of regions where young people prostrate themselves before books and crudely kiss their pages but do not know how to decipher a single letter. +Epidemics, heresies, pilgrimages that inevitably degenerate into hooliganism, have decimated the population. +I believe I mentioned suicides, whose numbers rise every year. +Perhaps age and fear deceive me, yet I suspect that the human race - the only race - stands on the brink of extinction but that the Library will live on - its lights burning, unvisited, infinite, perfectly still, and bristling with precious, useless, incorruptible, secret volumes. diff --git a/.ipynb_checkpoints/define-this-checkpoint.py b/.ipynb_checkpoints/define-this-checkpoint.py new file mode 100644 index 0000000..c77cb58 --- /dev/null +++ b/.ipynb_checkpoints/define-this-checkpoint.py @@ -0,0 +1,88 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv +import getch +import random + +currentCard = 0 +cardHeight = 140 +cardWidth = 40 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newTitle = "" +newLines = [" "] +babelpos = 0 + +with open('babel.txt', 'r') as fb: + babel = fb.read() + fb.close() + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +def fileWrite(char): + with open('the-record.txt', 'a') as file: + file.write(char) + file.close() + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +def getInput(): + incard = 1 + while incard: + char = getch.getch() + if char == 9: + incard = 0 + currentCard+=1 + break + elif char == 13: + os.system('echo "LB' + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + else: + os.system('echo "LB' + char + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +def getInputBabel(): + incard = 1 + while incard: + char = getch.getch() + if char == 9: + incard = 0 + currentCard+=1 + break + else: + os.system('echo "LB' + babel[babelpos] + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + babelpos += 1 + +#-------------------------------------------------------- +# Positioning it on the page at the next card location +# get basic position for the card +def positionCard(): + global cardX + global cardY + cardX = 0+currentCard//3*cardWidth + cardY = 59+currentCard%3*cardHeight + os.system('echo "PA' + str(cardX) + ',' + str(cardY) + ';" > /dev/ttyUSB0') + +while currentCard < 18: + print("Enter the body line by line. Press ^C to cancel") + os.system('echo "IN;" > /dev/ttyUSB0') + os.system('echo "SC0,379,0,250,2;" > /dev/ttyUSB0') + os.system('echo "DR0,1;" > /dev/ttyUSB0') + # os.system('echo "DT#,1;" > /dev/ttyUSB0') + + positionCard() + if(random.random()>0.9): +# getInput() + getInputBabel() + else: + getInput() \ No newline at end of file diff --git a/.ipynb_checkpoints/definitions-checkpoint.csv b/.ipynb_checkpoints/definitions-checkpoint.csv new file mode 100644 index 0000000..a2c5168 --- /dev/null +++ b/.ipynb_checkpoints/definitions-checkpoint.csv @@ -0,0 +1 @@ +fermenting,"[' ', 'Fermenting is', 'the process of', 'decomposing']" diff --git a/.ipynb_checkpoints/getch-test-checkpoint.py b/.ipynb_checkpoints/getch-test-checkpoint.py new file mode 100644 index 0000000..e0df9e0 --- /dev/null +++ b/.ipynb_checkpoints/getch-test-checkpoint.py @@ -0,0 +1,14 @@ +import os +import getch +from time import sleep + +def fileWrite(text): + with open('the-record-getch3.txt', 'a') as file: + file.write(text) + file.close() + +while 1: + text = getch.getch() +# sleep(1) + print(text) + fileWrite(text) \ No newline at end of file diff --git a/.ipynb_checkpoints/keyboard-in-checkpoint.py b/.ipynb_checkpoints/keyboard-in-checkpoint.py new file mode 100644 index 0000000..1e76006 --- /dev/null +++ b/.ipynb_checkpoints/keyboard-in-checkpoint.py @@ -0,0 +1,40 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv + +userText = ["growing","write seven","words onto","a card"] +currentCard = 0 +cardHeight = 95 +cardWidth = 70 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newLines = [" "] + + +#-------------------------------------------------------- +# Getting the input from the keyboard one line at a time +# If you want to do stuff one character at a time maybe use getch +newTitle = input("Enter a title: ") + +print("Enter the body line by line. Press x then enter to cancel") +while newLines[-1] != "x": + newLines.append(input("Type: ")) +newLines = newLines[:-1] + +print(newTitle) +for line in newLines: + print(line) + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +with open('definitions.csv', 'a', newline='') as file: + writer = csv.writer(file) + writer.writerow([newTitle, newLines]) + file.close() \ No newline at end of file diff --git a/.ipynb_checkpoints/keyboard-in-getch-checkpoint.py b/.ipynb_checkpoints/keyboard-in-getch-checkpoint.py new file mode 100644 index 0000000..638d699 --- /dev/null +++ b/.ipynb_checkpoints/keyboard-in-getch-checkpoint.py @@ -0,0 +1,47 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv +import getch + +userText = ["growing","write seven","words onto","a card"] +currentCard = 0 +cardHeight = 95 +cardWidth = 70 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newLines = [" "] + + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +# If you want to do stuff one character at a time maybe use getch + +print("Enter the body line by line. Press ^C then enter to cancel") +os.system('echo "IN;" > /dev/ttyUSB0') +os.system('echo "SC0,379,0,250,2;" > /dev/ttyUSB0') +# os.system('echo "DT#,1;" > /dev/ttyUSB0') + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +def fileWrite(char): + with open('the-record.txt', 'a') as file: + file.write(char) + file.close() + +while 1: + char = getch.getch() + if char == 13: + os.system('echo "LB' + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + else: + os.system('echo "LB' + char + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + +# os.system('echo "#;" > /dev/ttyUSB0') \ No newline at end of file diff --git a/.ipynb_checkpoints/the-record-checkpoint.txt b/.ipynb_checkpoints/the-record-checkpoint.txt new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/.ipynb_checkpoints/the-record-checkpoint.txt @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/20221122-define-this.py b/20221122-define-this.py new file mode 100644 index 0000000..da2dd2b --- /dev/null +++ b/20221122-define-this.py @@ -0,0 +1,115 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv + +userText = ["growing","write seven","words onto","a card"] +currentCard = 0 +cardHeight = 95 +cardWidth = 70 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newTitle = "" +newLines = [" "] + + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +def getInput(): + global newLines + global newTitle + newLines = [" "] + + newTitle = input("Enter a title: ") + + print("Enter the body line by line. Press x then enter to cancel") + while newLines[-1] != "x": + newLines.append(input("Type: ")) + newLines = newLines[:-1] + + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +def saveInput(): + global newTitle + global newLines + with open('definitions.csv', 'a', newline='') as file: + writer = csv.writer(file) + writer.writerow([newTitle, newLines]) + file.close() + + +#-------------------------------------------------------- +# Converting it to HPGL with some nice formatting + + +#-------------------------------------------------------- +# Positioning it on the page and sending it to the printer +## A very rough way to do this would be to wrap each hpgl command in bash. Chiplotle is probably better? + +# First some hpgl setup. This needs to know which cards have been used in future, and position the pen based on what card were on in a matrix. +print(f"""IN +SP1 +SC0,{pageWidth+1},0,{pageHeight+1},2 +DT.,1; +""") + +# get basic position for the card +def positionCard(): + global cardX + global cardY + cardX = 0+currentCard//3*cardWidth + cardY = 59+currentCard%3*cardHeight + +# write da writing +def printCard(): + print("---------start of card--------") + global currentCard + global cardHeight + global cardWidth + global cardX + global cardY + global locX + global locY + global lineHeight + global newTitle + global newLines + + locX = cardX + locY = cardY + + print("card " + str(currentCard)) + for line in newLines: + # first line is the title + if newLines.index(line) == 0: +# print("PA" + str(locX) + "," + str(locY)) +# print("LB"+newTitle+".") +# print(" ") + os.system('echo "PA' + str(locX) + ',' + str(locY) + '" > /dev/ttyUSB0') + os.system('echo "LB' + newTitle + '." > /dev/ttyUSB0') + locY -= 2*lineHeight + + # all the other lines + else: +# print("PA" + str(locX) + "," + str(locY)) +# print("LB"+line+".") + os.system('echo "PA' + str(locX) + ',' + str(locY) + '" > /dev/ttyUSB0') + os.system('echo "LB' + line + '." > /dev/ttyUSB0') + locY -= lineHeight + print("----------end of card---------") + currentCard+=1 + + +while currentCard < 18: + getInput() + saveInput() + positionCard() + print("cardXY: " +str(cardX) + "," + str(cardY)) + printCard() + positionCard() diff --git a/__pycache__/getch.cpython-39.pyc b/__pycache__/getch.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9a4fc9488886168b44f387fcd06c1e4edd7eeaf GIT binary patch literal 244 zcmYk1zY4-Y48||LR;t)Ha27h$?jqt7xVUu_FW5r=c|AP^H(x|YU+GpC3qFC9xppy- z@5?WcglvOg#3(-R>#ibyS@;i!U`5%?Ndyy+v!r)OfY`~Mf+rjp!W|wgaghst17Z(d z>xYSe4GZ0t=Gi&~<25;A-2!1aFizDNZ;xu18dqfnN_&t>JS*eXGAq@S$szSR`A*~0 qR>oTESj$Xdl%m9_FUv~D-J)52G5(^c#4*REJ=541eehw-t^NQ!{W(DZ literal 0 HcmV?d00001 diff --git a/babel.txt b/babel.txt new file mode 100644 index 0000000..8c02cb3 --- /dev/null +++ b/babel.txt @@ -0,0 +1,112 @@ +The world (which some call the Library) is made up of an unknown, or perhaps unlimited, number of hexagonal galleries, each with a vast central ventilation shaft surrounded by a low railing. +From any given hexagon, the higher and lower galleries can be seen stretching away interminably. +The layout of every floor is identical. +Twenty-five long shelves, five on each side, fill all the sides but one; the height of the shelves, which is the height of the walls, is little more than that of the average librarian. +From the unshelved side, a narrow passageway leads off to another gallery, which is identical to the first and to all the others. +To left and right of the passageway are a pair of tiny cupboards. +One is used for sleeping upright; the other, for satisfying faecal necessities. +From this passage a spiral stairway climbs up, or goes down, to the uttermost reaches. +The passageway contains a mirror, which faithfully duplicates what appears before it. +From this, most people infer that the Library is not infinite, for, if it were, why this illusion of duplication? I prefer to imagine that the mirror’s gleaming surface depicts and promises infinity. +Illumination comes from spherical fruit called lamps. +There are two, opposite each other, in each hexagon. +Their light is inadequate, though continuous. +Like all men in the Library, in my youth I travelled, roaming in search of a book, perhaps of a catalogue of catalogues. +Now, when my eyes can barely make out what I write, I am getting ready to die a league or two from the hexagon where I was born. +Once I am dead, there will be no want of pious hands to hurl me over the railing. +My grave will be the bottomless air; my body will plummet for a long, long time, decaying and dissolving in the wind generated by my fall, which will be infinite. +I have said that the Library is limitless. +Idealists argue that hexagonal chambers are the quintessential form of absolute space or, at least, of our perception of space. +A triangular or five-sided chamber, they reason, is unimaginable. +(Mystics claim that their ecstasies reveal a circular chamber with a great circular book, whose continuous spine runs all the way round the walls, but the evidence of these seers is suspect and their words obscure. +Such a cyclical book is God.) For now, I need only quote the classic dictum that ‘The Library is a sphere whose exact centre is any hexagon and whose circumference is beyond reach.’ Each wall but one of each hexagon has five shelves; each shelf holds thirty-two books of a uniform size. +Each book contains four hundred and ten pages; each page, forty lines; each line, eighty characters in black letter. +There are also characters on the spine of each book but they give no indication or forewarning of what is inside. +I know that this discrepancy was once looked on as a mystery. +Before I run through the explanation (whose discovery, despite its tragic ramifications, may be the most important event in history), let me call to mind a few salient facts. +First, that the Library has always existed. +Of this truth, whose direct corollary is that the world will always exist, no reasonable mind can be in doubt. +Man, the imperfect librarian, may be a creation of chance or of evil lesser deities. +The world, with its elegant supply of bookshelves, of baffling volumes, of inexhaustible stairways for the traveller and privies for the seated librarian, can only be the creation of a god. +To appreciate the distance between the divine and the human, all we need do is compare the crude, spidery symbols my fallible hand is scrawling on the endpapers of this book with the organic letters on the inside, which are precise, fine, deep black, and perfectly symmetrical. +Second, that the number of these symbols is twenty- five.* The discovery of this fact three hundred years ago led to the formulation of a general theory of the Library and to a satisfactory solution of a problem which, until then, no hypothesis had addressed - namely, the formless and random nature of almost all books. +One, once seen by my father in a hexagon of Circuit 1594, consisted of a relentless repetition, from beginning to end, of the letters M C V. +Another, frequently consulted in this zone, is nothing more than a labyrinth of letters but its second-to-last page reads, ‘O time your pyramids.’ We now know that for every coherent or straightforward line there are leagues of nonsensical, clashing sounds, verbal hodgepodge, and gibberish. +(I know of a wild hinterland whose librarians reject the superstitious and pointless custom of looking for meaning in books, which they equate with seeking meaning in dreams or in the haphazard lines of one’s hand. +They admit that the inventors of writing imitated the twenty- five natural symbols, but they maintain that their use is accidental and that books in themselves mean nothing. +This notion, as we shall see, is not entirely false.) For a long time it was believed that these impenetrable books were works in dead or remote languages. +It is true that earliest man, the first librarians, used a language very different from the one we speak now; it is true that some miles to our right the language spoken is a dialect and that ninety floors above us that dialect is incomprehensible. +All this, I repeat, is true, but four hundred and ten pages of unbroken lines of M C V can be part of no language, however primitive or however much of a dialect it may be. +Some people suggested that each letter might have a bearing on the one after it and that the meaning of M C V in the third line of page 71 was not the same as that of these letters in another position on another page, but this embryonic theory came to nothing. +Others believed that these letter sequences were codes, a hypothesis that has been widely accepted, although not in the sense intended by its originators. +Five hundred years ago, the head of an upper hexagon* came across a book as confused as the rest but which had almost two pages of identical lines. +He showed his find to a peripatetic cryptographer, who told him they were in Portuguese. +Others said they were Yiddish. +Within a hundred years, the language had been established as a Samoyed- Lithuanian dialect of Guarani, with inflections from classical Arabic. +The contents, which were also decoded, proved to be theories of synthetic analysis, illustrated by endlessly repeated examples of variations. +Such examples led one librarian of genius to stumble on the Library’s fundamental law. +This thinker noted that all the books, however different they may be, have identical elements - the space, the full stop, the comma, and the twenty-two letters of the alphabet. +He also claimed something that all travellers have confirmed - that in the whole vast Library no two books are the same. +From these undeniable premises he deduced that the Library is complete and that its shelves hold all possible permutations of the twenty-odd symbols (a number which, although vast, is not infinite) or, in effect, everything that can be expressed in all languages - a history of the future down to the last detail, the autobiographies of the archangels, a true catalogue of the Library, thousands and thousands of false ones, a proof of the falseness of these catalogues, a proof of the falseness of the true catalogue, the Gnostic gospel of Basilides, a commentary on this gospel, a commentary on the commentary on this gospel, a true account of your death, translations of each book into all languages, interpolations from each book into every other book. +When it was announced that the Library was the repository of all books, the initial response was one of unrestrained joy. +Men everywhere felt they were lords of a secret and still intact treasure. +There was no individual or world problem for which an eloquent solution did not exist in some hexagon. +The universe had been justified and at a stroke had usurped the limitless dimensions of hope. +At the time, there was much talk of the Vindications - books of apologia and prophecy, which justified for ever the actions of each man on earth and held wondrous mysteries concerning his future. +Thousands of avid seekers abandoned their comfortable native hexagons and rushed upstairs and down, driven by a fruitless urge to find their particular Vindication. +These pilgrims wrangled in the narrow passageways, uttering dark curses and seizing each other by the throat on the divine stairways; they flung the deceiving books into the bottomless pit of the shafts and were hurled to their deaths by men from distant regions. +Others went mad. +The Vindications exist (I have seen two that tell of people in the future, who may not be imaginary), but the seekers forgot that the likelihood of a man’s finding his own apologia - or some false version of it - is next to nil. +It was also hoped at that period that the fundamental mysteries of human life - the origin of the Library and of time - would be revealed. +Clearly, these deep mysteries can be explained in words, and, should the language of philosophers be inadequate, the multiform Library will doubtless have produced the undiscovered language that is required, together with its vocabulary and grammar. +For four hundred years, men have been exhausting the hexagons. +There are official searchers, or inquisitors. +I have seen them in the performance of their work. +They always arrive bone weary, talking about a stairway with missing steps, which was nearly the death of them. +They talk to the librarian about galleries and staircases. +Sometimes they pick out the nearest book and leaf through it in search of shameful words. +Plainly, none of them expects to find anything. +Of course, the excessive hope was followed by extreme depression. +The conviction that some shelf in some hexagon held precious books and that these precious books were inaccessible seemed almost too much to bear. +A blasphemous sect suggested that the searches stop and that everyone keep scrambling and re-scrambling the letters and symbols until, through an improbable stroke of luck, the canonical books emerged. +The authorities felt obliged to lay down strict rules. +The sect disappeared, but in my childhood I saw old men who for long periods hid in the privies, with some metal disks in a forbidden shaker, trying feebly to ape the divine disorder. +Others, conversely, believed that the most important thing was to eliminate useless works. +These men, showing credentials that were not always false, invaded the hexagons, pored over a single volume and condemned whole shelves. +To their ascetic zeal for cleansing we owe the senseless loss of millions of books. +The names of these perpetrators are still cursed, but those who mourn the ‘treasures’ destroyed in such frenzy overlook two wellknown facts. +One, that the Library is so vast that any loss caused by humans is necessarily minute. +The other, that each copy is unique, irreplaceable, but since the Library is a totality there are always several hundred thousand imperfect copies - works that differ in no other detail than a letter or a comma. +Contrary to general opinion, I take the view that the damage caused by the Purifiers’ raids has been exaggerated as a result of the terror these fanatics unleashed. +A madness drove them to defeat the books of the Crimson Hexagon - books of a smaller than average size, which were all-powerful, illustrated, and magical. +We also know of another superstition of that time - that of the Man of the Book. +On some shelf in some hexagon, it was said, there must be a book that is the sum and substance of all the others. +A certain librarian has studied it and he is akin to a god. +In the language of this particular zone, traces of the worship of this long-dead official remain. +Many have made pilgrimages in search of Him. +For a hundred years, they vainly exhausted every possible path. +How were they to discover the venerated secret hexagon that gave Him shelter? Someone suggested that they should try working backwards. +To find book A, first consult book B, which will tell where A is; to find book B, first consult book C, and so on ad infinitum. +I have squandered and used up my years in quests of this kind. +It seems to me quite possible that on some shelf or other in the world there may be an all-embracing book.* I pray the unknown gods that one man - just one, even if thousands of years ago - has examined and read it. +If honour and wisdom and happiness are not my lot, may they be the lot of others. +May heaven exist, even if my place is in hell. +Let me be reviled and obliterated, so long as for a single instant - in a single being - Your vast Library finds justification. +Unbelievers insist that in the Library nonsense is the norm, while reason (or even simple, lowly coherence) is an almost miraculous exception. +I know they speak of ‘the feverish Library, any one of whose haphazard volumes runs the endless risk of turning into any other and that all books affirm, deny, or cast confusion on this fact like a god in a state of delirium’. +These words, which not only denounce but also exemplify chaos, are a clear proof of bad taste and hopeless ignorance. +In fact, the Library includes every verbal structure and every permutation that the twenty-five symbols permit but not a single piece of sheer nonsense. +It is of no purpose to point out that the best book in the many hexagons I administrate is entitled Combed Thunder, and another The Plaster Cramp, and a third Axaxaxas Mlö. +These titles, although at first sight meaningless, must lend themselves to some coded or allegorical interpretation. +Such an interpretation consists of words and so, by definition, is in the Library. +I can make no combination of letters - even dhcmrlchtdj - which the divine library has not envisaged and that in one or another of its secret languages does not hold some fearful meaning. +Any syllable full of tenderness or fear uttered in any one of those languages is the all-powerful name of a god. +To speak is to fall into tautology. +The present futile, long-winded epistle already exists in one of the thirty-two volumes of the five shelves in one of the numberless hexagons - as does its refutation. +(An n number of possible languages use the same vocabulary; in some, the symbol for ‘library’ correctly denotes ‘a ubiquitous, ever-lasting system of hexagonal galleries’, but in others ‘library’ is ‘bread’ or ‘pyramid’ or anything else, and the seven words that define it have another meaning. +Are you sure, you who are reading this, that you understand my language?) The act of writing methodically distracts me from the current condition of mankind. +The certainty that everything is already written negates or makes phantoms of us. +I know of regions where young people prostrate themselves before books and crudely kiss their pages but do not know how to decipher a single letter. +Epidemics, heresies, pilgrimages that inevitably degenerate into hooliganism, have decimated the population. +I believe I mentioned suicides, whose numbers rise every year. +Perhaps age and fear deceive me, yet I suspect that the human race - the only race - stands on the brink of extinction but that the Library will live on - its lights burning, unvisited, infinite, perfectly still, and bristling with precious, useless, incorruptible, secret volumes. diff --git a/define-this.py b/define-this.py new file mode 100644 index 0000000..c77cb58 --- /dev/null +++ b/define-this.py @@ -0,0 +1,88 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv +import getch +import random + +currentCard = 0 +cardHeight = 140 +cardWidth = 40 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newTitle = "" +newLines = [" "] +babelpos = 0 + +with open('babel.txt', 'r') as fb: + babel = fb.read() + fb.close() + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +def fileWrite(char): + with open('the-record.txt', 'a') as file: + file.write(char) + file.close() + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +def getInput(): + incard = 1 + while incard: + char = getch.getch() + if char == 9: + incard = 0 + currentCard+=1 + break + elif char == 13: + os.system('echo "LB' + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + else: + os.system('echo "LB' + char + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +def getInputBabel(): + incard = 1 + while incard: + char = getch.getch() + if char == 9: + incard = 0 + currentCard+=1 + break + else: + os.system('echo "LB' + babel[babelpos] + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + babelpos += 1 + +#-------------------------------------------------------- +# Positioning it on the page at the next card location +# get basic position for the card +def positionCard(): + global cardX + global cardY + cardX = 0+currentCard//3*cardWidth + cardY = 59+currentCard%3*cardHeight + os.system('echo "PA' + str(cardX) + ',' + str(cardY) + ';" > /dev/ttyUSB0') + +while currentCard < 18: + print("Enter the body line by line. Press ^C to cancel") + os.system('echo "IN;" > /dev/ttyUSB0') + os.system('echo "SC0,379,0,250,2;" > /dev/ttyUSB0') + os.system('echo "DR0,1;" > /dev/ttyUSB0') + # os.system('echo "DT#,1;" > /dev/ttyUSB0') + + positionCard() + if(random.random()>0.9): +# getInput() + getInputBabel() + else: + getInput() \ No newline at end of file diff --git a/definitions.csv b/definitions.csv new file mode 100644 index 0000000..2412892 --- /dev/null +++ b/definitions.csv @@ -0,0 +1,30 @@ +growing,"[' ', 'GRowing is', 'the best', 'ing']" +growing,"[' ', 'this', 'is ', 'the ', 'growing']" +fermenting,"[' ', 'its fermenting', 'time now']" +growing,"[' ', 'this is a ', 'new type of', 'growing']" +weeding,"[' ', 'weeding', 'is', 'cool']" +weeding,"[' ', 'this is', 'more weeding']" +gleaning,"[' ', 'gleaning now']" +washing,"[' ', 'washing is a garden', 'thing too I think']" +,[' '] +,[' '] +,[' '] +,[' '] +,[' '] +,[' '] +,[' '] +,[' '] +weeding,"[' ', 'this', 'ios weeding']" +thising,"[' ', 'weed', 'is ', 'thising']" +growing,"[' ', 'this is', 'the body of', 'the text']" +weeding,"[' ', 'this is', 'another test']" +growing,"[' ', 'take 3 cards']" +running,"[' ', 'nwefnaef asfdjsdf']" +testing,"[' ', 'copy three', 'words to', 'a card']" +testing,"[' ', 'copy three', 'words to', 'a card']" +testing,"[' ', 'hello test']" +helloing,"[' ', 'la la la', 'hi hi hi', 'test']" +test54,"[' ', 'this is test', 'number 54']" +test 55,"[' ', 'this is t', 'est 55']" +test56,"[' ', 'this is', 'test no', '56']" +test57,"[' ', 'this is', 'test number', '5007']" diff --git a/getch-test.py b/getch-test.py new file mode 100644 index 0000000..e0df9e0 --- /dev/null +++ b/getch-test.py @@ -0,0 +1,14 @@ +import os +import getch +from time import sleep + +def fileWrite(text): + with open('the-record-getch3.txt', 'a') as file: + file.write(text) + file.close() + +while 1: + text = getch.getch() +# sleep(1) + print(text) + fileWrite(text) \ No newline at end of file diff --git a/keyboard-in-getch.py b/keyboard-in-getch.py new file mode 100644 index 0000000..638d699 --- /dev/null +++ b/keyboard-in-getch.py @@ -0,0 +1,47 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv +import getch + +userText = ["growing","write seven","words onto","a card"] +currentCard = 0 +cardHeight = 95 +cardWidth = 70 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newLines = [" "] + + +#-------------------------------------------------------- +# Getting the input from the keyboard one character at a time +# If you want to do stuff one character at a time maybe use getch + +print("Enter the body line by line. Press ^C then enter to cancel") +os.system('echo "IN;" > /dev/ttyUSB0') +os.system('echo "SC0,379,0,250,2;" > /dev/ttyUSB0') +# os.system('echo "DT#,1;" > /dev/ttyUSB0') + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +def fileWrite(char): + with open('the-record.txt', 'a') as file: + file.write(char) + file.close() + +while 1: + char = getch.getch() + if char == 13: + os.system('echo "LB' + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + else: + os.system('echo "LB' + char + chr(3) + ';" > /dev/ttyUSB0') + fileWrite(char) + +# os.system('echo "#;" > /dev/ttyUSB0') \ No newline at end of file diff --git a/keyboard-in.py b/keyboard-in.py new file mode 100644 index 0000000..1e76006 --- /dev/null +++ b/keyboard-in.py @@ -0,0 +1,40 @@ +# This is a program that takes keyboard input and prints it out ont a card shaped piece of paper using a pen plotter + +# Global stuff +import os +import csv + +userText = ["growing","write seven","words onto","a card"] +currentCard = 0 +cardHeight = 95 +cardWidth = 70 +pageHeight = 249 +pageWidth = 378 +cardX = 0 +cardY = pageHeight +lineHeight = 10 +locX = 0 +locY = 0 +newLines = [" "] + + +#-------------------------------------------------------- +# Getting the input from the keyboard one line at a time +# If you want to do stuff one character at a time maybe use getch +newTitle = input("Enter a title: ") + +print("Enter the body line by line. Press x then enter to cancel") +while newLines[-1] != "x": + newLines.append(input("Type: ")) +newLines = newLines[:-1] + +print(newTitle) +for line in newLines: + print(line) + +#-------------------------------------------------------- +# Sneakily saving it maybe to a txt file for alternative documentation +with open('definitions.csv', 'a', newline='') as file: + writer = csv.writer(file) + writer.writerow([newTitle, newLines]) + file.close() \ No newline at end of file diff --git a/the-record.txt b/the-record.txt new file mode 100644 index 0000000..0b97797 --- /dev/null +++ b/the-record.txt @@ -0,0 +1,29 @@ +testtest2 +test3test +test4 hellondn1234567890 +123456789 +12345678 1234567 +123456 12345 +1234 +123 +12 1qwertyuiop mnkbj mfjgfj +dsfnjsgdasdf ahsj ssf +test +ththis should be typing + fffftest +ea metal shell +yyou cant live herehedyoucant live here fff +fa metal shell +you cant live here +oranging salamino + + + + + +hello boyana +hi stephen. this is# +so cols +###hi +yes this is better +oranging  \ No newline at end of file diff --git a/ttyUSB0 b/ttyUSB0 new file mode 100644 index 0000000..5f0c097 --- /dev/null +++ b/ttyUSB0 @@ -0,0 +1 @@ +PA0,0;