read write.as

Share freely. Learn how.

from Upāsaka

Over the course of time, views become straitjackets of the mind, preventing the mind from achieving liberation.

This happens when the mind clings to a view. For example, one might have the opinion that getting soaked in the rain is an annoying and unfortunate event. As one thinks this every time the event happens, a mental habit forms. This is what we call a view.

But that view does not align with reality, for getting soaked in the rain is neither good nor bad. It is what it is. Regardless, people still cling to the view, and they suffer as a result. This view is a straitjacket of the mind that prevents the mind from exploring other ways of seeing the situation. One might be able to perceive getting soaked in the rain as a fun and refreshing experience if it were not for the straitjacket.

To remove the straitjacket, one must carefully observe reality and always question whether a view is truly correct. This is difficult, as the view may be the result of years of mental conditioning. One must really get to the foundation of an experience and reexamine it. Only then does the straitjacket loosen up and possibly release its hold on the mind.

 
Read more...

from Sober Thoughts

Dear Metropolis,

Tomorrow I will buy a from you a book, written by someone who isn't me or you. I will then see some art, which lives here because of your glorious cultural prowess. In the morning I will run some kilometres in you with hundreds of others. You may also notice me hoovering, cooking, shaving and making my bed, friends, drinks, love and peace under the stars. You will show me all the good things that are missing from my soul.

Tonight I will do nothing of the sort and indeed nothing at all. I am numb. I can't even get up to make myself a green tea. There's actually half a bottle of red wine over there, which I am completely unsure whether I want. Blog posts keep my sanity or expose that I am insidesane. It's raining right now.

The supermarket car park was so busy today! It really knocked my socks off and I found myself not being to cope without sneering at drivers like an entitled piece of pedestrian shit. In other news

Kind Regards

Best Wishes

I opened up a package that arrived for a previous occupier of my flat. Lo and behold I am now the proud owner of a state of the art electric toothbrush and a lovely new kettle. It boils water quicker than our previous kettle and that makes me very very happy. As for the toothbrush, it has so many functions! These days they can do everything! This one can even make your anus shine.

By the way, this post is to be read to these sounds. This is the context in which it was written, after all. If you want to fully brush up on context, you'll need to know that the bluetooth speakers only played (controlled via laptop, via alexa) when the TV was muted for advert breaks. This means that my writing was constantly interrupted by glances up at the TV to check I'm wasn't missing any TRASH.

All the best

Beam of consciousness xx

Pea S

Every day that passes by I have come to realise

this is probably a good time to make some toast, drink some wine or wrap this thing up. What I need is one those machines you get nowadays to wash dishes, you inconsiderate bastards. I hate that I can do whatever I want and have decided that this here is the best use of my time right now. I derive a lot of joy from

 
Read more...

from jonbeckett

After a pretty spectacular falling down episode last night, I agreed to meet our eldest daughter for lunch today – to provide her an escape from work for half an hour. We're not entirely sure why such an escape is needed, but when you're trying to put somebody that doesn't appear to be in pieces back together again, you're kind of willing to try anything – or at least I am.

There is only one problem with visiting my daughter at lunchtime – a mini version of a Tour de France mountain stage to reach her. I cycle to work – the office is next to the river in the bottom of a beautiful country estate. Also, my bicycle is somewhat simplistic – it has no gears – meaning that I have no gears to change down through when faced with hills. In true murphy's law fashion, my daughter works just outside of town – a mile of steep climb winding through the estate. Add driving rain and wind today, and you're starting to get some sort of mental picture.

The first few hundred yards weren't too bad – my legs vaguely remembered the days when I used to go out training on a bike, and put some considerable power down. Unfortunately after half a mile of continual climb, lactic acid, and lack of talent kicked in – reducing me to a pathetic crawl.

I made it though.

After continuing on for half a mile, I spotted my daughter standing near a bus shelter – her hood up, hiding under a tree from the really quite ridiculous rain.

When we arranged meeting up, I had thought we might sit in the sunshine and enjoy a picnic together. Reality reduced us to standing under a copse of trees, eating wraps from the supermarket while squinting up at the bows above – wondering where best to stand – not that it would have made much difference to me by that stage.

Sitting and writing this nearly twelve hours later, I'm wondering if my legs have forgiven me yet. The thought has occurred to me that if this becomes a regular thing, I might actually become fit again – or fitter than I am at the moment at least. Years ago I used to make time to run two or three times a week – mostly because it was free. Maybe I should try and get back to that – you know, along with reading books, watching movies, writing, and all the other things I keep promising to make time for.

 
Read more...

from CJ Eller

What if you were the only subscriber for a blog? Nobody else would read that blog but you.

I have been thinking about this with Write.as' email subscription feature. Only you would receive an email when a new post popped up.

Why do this? For it would be idiotic for you to receive notifications about posts you published in the first place. Indeed, but what if you were not publishing the posts directly? Maybe you have a web app that generates a post with data coming from an event elsewhere.

Write.as becomes an event listener of sorts. A blog could be a collection of posts generated from a form, a collection of messages from a Slack channel, a collection of various text based things. All of which would be notified via email and accessible from your Write.as blog.

And I think that is where the term “blog” becomes fuzzy amidst these kind of use cases. “Collection” works much better (and is used within Write.as' API documentation). A collection can be, well, a collection of whatever posts you like. Not just blog posts. Not just essays. Not just poetry. It does not have to be a blog. Your collection can be an inbox, an event log, an inventory, whatever you'd like.

Here's to more use cases.

 
Read more...

from Organized Chaos Rebooted

Post Installation Task For Boot and other items!

MSI Dragon Logo

The MSI GV62 -8RD Laptop is a great value for dollar Vs. capabilities. Best of all it runs our favorite OS without a hitch. OK there is a little tweaking, and a compromise to take place. But once you get past both, you have a system that is a scorcher!

So first let's dive in to the compromise. The system comes with the NVIDIA GP107M [GeForce GTX 1050 Ti Mobile]. If you want this thing to look as pretty as it can be you will have to go against the wishes of the FSF. If you don't know what the FSF is then just do your thing.

The second item on the list is the system will hang after a Linux installation is completed. The problem here is the quiet splash setting in grub. To get past this issue, as soon as the system starts to boot do the following:

Press e
Delete "Quiet splash"
Replace with "nomodeset"
Press F10 to reboot.

This is all great but what is nomodeset?

The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesn't work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.

All said and done, I had installed, rebooted and configured nomodeset. Then I boot into the OS, I went straight for the NVIDIA driver configuration. Once that is done, reboot and you should be golden! You'll have a beautiful start screen in all it's high resolution glory.

For this laptop the best installs (as I distro hop like no bodies business) have been

  • LinuxMint
  • Ubuntu
  • MXLinux

All find the hardware and you are up and running quickly. If you are purist, try PureOS but you will have to make compromises going this route as mentioned earlier in this post.

G. Love #HowTo #Install #Linux #Video

— G. Love

 
Read more...

from triptych

I'm working steadily on STIM and having a great time coding it up. It's been a long time since I've had “fun” building something on the web. And it's been because I have stopped feeling guilty about knowing some framework or doing it the “best way”. I'm using a collection of open source projects to build it and not reinvent the wheel.

Other than that, I'm looking forward to playing a game called Dragon Quest Builders 2 which is this really fun RPG/sandbox game.

The theme for the rest of this year is “output” and I aim to follow that.

Look for more posts soon on my progress on STIM

 
Read more...

from Erik I

... and yes, I am a programmer

I think there are a number of reasons why we think the code we are maintaining is often so crazy, and I’m trying to summarize it for a blog post, but for now:

  • survivorship bias: a number of the teams that kept arguing about the perfect way to solve the problem never shipped, meaning no one needs to maintain their almost perfect code. The code that survived is the code that was shipped in time -for some definition of “in time”.

  • the code that was actually flawless of course doesn’t have to be maintained.

  • I think we programmers are way to full of ourselves when it comes to judging other peoples work. We can nitpick about code lines or code style in code that has run more or less flawlessly in distributed systems for years or even decades, instead of seeing the beauty of someone being able to achieve that with 80ies technology.

Filed under #programming and #perfectionism

 
Read more...

from 365 RFCs

by Darius Kazemi, May 13 2019

In 2019 I'm reading one RFC a day in chronological order starting from the very first one. More on this project here. There is a table of contents for all my RFC posts.

Sorry, forget it

RFC-133 is titled “File Transfer and Error Recovery”. It's authored by R. L. Sunberg of Harvard, and is his only RFC.

The technical content

This document is three broad commentaries, one on File Transfer (RFC-114), one on error recovery in general, and one on NCP version identification.

It also contains some lovely “conversations” between server and client.

The author wants the server to have the “last work” in all file transfers, and all messages sent should prompt a response from the receiver. So there should be no such thing as a “fire and forget” message. Here's an example conversation between local and remote server file transfer, with the server notably at the end saying “All done”.

  • Establish a connection
  • Identify self
  • Ok, ready
  • Retrieval request
  • I've got your file
  • Send it
  • Here's the first part
  • Got it
  • All done
  • Store request
  • Ok, go ahead
  • Here's some protection stuff
  • Ok
  • Here's the file
  • Got it. All done.

The author also recommends that there be mechanisms in FTP for addressing individual pieces of a file, which will be useful for extremely large files. He provides a formal mechanism to do so, which he recommends be added to the FTP spec.

In the next section, Sunberg notes that “[e]rror recovery procedures have been noticeably lacking to date” and mostly involve restarting the entire connection and trying the whole thing from the start if an error is detected at any point. He proposes a way to recover from a one-sided error that doesn't involve restarting the connection.

Here's his conversation that he uses to illustrate this:

  • Send me this file
  • Ok, I've got it
  • Ready
  • Here it is (with an error)
  • No. (data) error
  • Sorry, forget it
  • Send the file (again)
  • Ready (doesn't get there)
  • (waiting)
  • Error, timeout
  • Sorry, forget it
  • Send the file (third time)
  • Got it
  • Ready
  • There it is
  • Got it
  • Done (finally)

If that doesn't work, then there should be a way to clear the link without closing any sockets. So it would be starting over but not completely, as an ICP would not need to be re-negotated. Finally, if that fails, the closing and opening the socket should be the last resort.

He also recommends that NCPs provide their version number so that a remote connection can tell what version of the NCP a host has implemented and can adjust accordingly.

How to follow this blog

You can subscribe to this blog's RSS feed or if you're on a federated ActivityPub social network like Mastodon or Pleroma you can search for the user “@365-rfcs@write.as” and follow it there.

About me

I'm Darius Kazemi. I'm an independent technologist and artist. I do a lot of work on the decentralized web with both ActivityPub and the Dat Project. You can support my work via my Patreon.

 
Read more...

from 365 RFCs

by Darius Kazemi, May 12 2019

In 2019 I'm reading one RFC a day in chronological order starting from the very first one. More on this project here. There is a table of contents for all my RFC posts.

Off by one

RFC-132 is titled “Typographical Error in RFC 107”. It's authored by Jim White of UCSB and dated April 28, 1971.

The technical content

This RFC provides a correction to RFC-107. It corrects an off-by-one error.

How to follow this blog

You can subscribe to this blog's RSS feed or if you're on a federated ActivityPub social network like Mastodon or Pleroma you can search for the user “@365-rfcs@write.as” and follow it there.

About me

I'm Darius Kazemi. I'm an independent technologist and artist. I do a lot of work on the decentralized web with both ActivityPub and the Dat Project. You can support my work via my Patreon.

 
Read more...

from 365 RFCs

by Darius Kazemi, May 11 2019

In 2019 I'm reading one RFC a day in chronological order starting from the very first one. More on this project here. There is a table of contents for all my RFC posts.

VIEWs on the network

RFC-131 is titled “Response to RFC #116 (May NWG Meeting)”, authored by Harslem and Heafner of RAND and dated April 1971.

The technical content

This RFC provides a general status update on RAND's ARPANET work.

They are making progress in implementing the new Host-Host Protocol and estimate completion by the end of May.

They're working on an experimental log-in system.

They are waiting on a TELNET specification, at which point they will implement a TELNET client and server, which they estimate will be about two weeks of work.

They are moving their network operations from an IBM 360/65 to a PDP-10. These are very different machines so the task is a pretty big one. The 360/65 will remain in legacy service but will receive no software updates after September.

The climate dynamics work being conducted between UCSB and RAND over the Network proceeds apace and they expect heavier usage in the future, along with a local graphics program that can render charts using remote data from UCSB.

RAND continues work on the Data Reconfiguration Service (more on this in my post on RFC-128). They also tease something called a Protocol Manager which will be coming soon in an RFC. However, this does not appear to have ever actually been released.

Finally, there is some criticism of Steve Crocker in his role as Network Working Group Chairman. This is mostly because subcommittees aren't acting fast enough to produce specifications that the network can use. The authors fully admit that their own subcommitte on Data Reconfiguration is in fact one of these laggards.

They also believe that the NWG is good for short and medium term goal-setting but for long range planning there should be a smaller group consisting of just the Principal Investigators at various primary ARPANET sites. This group could undertake long range Network planning.

Further reading

A standard line chart showing a curve of pressure plotted against altitude.

Here is the 1972 paper that describes the resulting system for building charts from remote data. It's called VIEW (Video Information Exchange Window).

There is also a 1974 paper that provides a broader overview of the Climate Dynamics Project and its use of computing, but I can't find an electronic version readily online.

How to follow this blog

You can subscribe to this blog's RSS feed or if you're on a federated ActivityPub social network like Mastodon or Pleroma you can search for the user “@365-rfcs@write.as” and follow it there.

About me

I'm Darius Kazemi. I'm an independent technologist and artist. I do a lot of work on the decentralized web with both ActivityPub and the Dat Project. You can support my work via my Patreon.

 
Read more...

from 365 RFCs

by Darius Kazemi, May 10 2019

In 2019 I'm reading one RFC a day in chronological order starting from the very first one. More on this project here. There is a table of contents for all my RFC posts.

Waiting on Telnet

RFC-130 is titled “Response to RFC #111 (Pressure from the Chairman)”. It's authored by John Heafner of RAND and dated April 22nd, 1971.

The technical content

This is a response to Steve Crocker's RFC-111, which I referred to as “an ultimatum”. In that RFC, John Heafner of RAND was given the duty of project manager to check in on how each site is progressing towards a full implementation of the new Host-Host Protocol. This was about 3 weeks prior to this RFC. Heafner is the author of this RFC.

Heafner says he can't really do this job until TELNET is finished. Once TELNET is done (as in, once there is a full specification in an RFC), then he will commence coordinating tests of the new protocol with remote sites.

How to follow this blog

You can subscribe to this blog's RSS feed or if you're on a federated ActivityPub social network like Mastodon or Pleroma you can search for the user “@365-rfcs@write.as” and follow it there.

About me

I'm Darius Kazemi. I'm an independent technologist and artist. I do a lot of work on the decentralized web with both ActivityPub and the Dat Project. You can support my work via my Patreon.

 
Read more...

from 365 RFCs

by Darius Kazemi, May 9 2019

In 2019 I'm reading one RFC a day in chronological order starting from the very first one. More on this project here. There is a table of contents for all my RFC posts.

Socket names

RFC-129 is titled “A Request for Comments on Socket Name Structure”. It's dated April 22nd, 1971, and it's authored by Harslem and Heafner of RAND, and Meyer of MIT's Project MAC.

The technical content

This RFC proposes two structures for socket names. Recall that a socket is a thing that the NCP can talk to, and the socket is connected to a process on the local host. The reason that you don't just connect to a process ID directly via the ARPANET is that process IDs can change. The idea is that the socket number remains constant throughout the duration of the connection and then the host itself can have a changing/arbitrary process ID behind the socket. This means the connecting host doesn't need to know about the internals of the remote computer.

The idea in this RFC is to propose more stringent limitations on what a socket number means.

There is already a convention that even sockets (where the least significant bit is a 0) are always receive sockets, and odd ones (LSB of 1) are send sockets. This RFC calls this the “gender” of a socket, which is a longstanding term that goes back, as many of these things do, to mechanical engineering terminology. And yeah it's basically because in actual mechanical device interfaces there is often a phallic looking thing going into a yonic looking thing.

Anyway, they set up this example that they're going to use to work through implications of the different socket naming conventions.

User A at Host A has agreed (by letter, telephone, etc.)
with User B at Host B for their respective processes to
establish a connection through the Network at a particular
time.  User B is to be waiting for the connection attempt
initiated by User A.  The issues to be faced are those of
addressing (how is User A to know to which socket to connect?),
and of security (how are both users to be confident that
they are talking each other, and not some interloper?).

One thing I love about this is that it's explicit that so much of this involves calling someone by phone at a different university and saying “okay I'm going to connect to you now”. (This is not that different from when you're having trouble connecting to a video conference call today and you need to call someone on their telephone to make sure you're connecting to the right video call.)

Arbitrary socket numbers

First they discuss “arbitrary” socket values, where aside from “gender” there is not any intrinsic meaning to the number of a socket.

One way to approach socket names is that, “gender” of the socket aside, the users on either side can pick any number they want for their socket as long as it's not currently in use. They coordinate ahead of time so that user A knows to send a request to B on the correct socket, and that B is sure to be listening on the correct socket for a connection from the remote socket pre-determined by user A. This unfortunately can result in socket conflicts because, for example, the socket chosen by user B might, by the time they make the connection, be in use by someone else. Also it requires private out-of-band communication ahead of time.

Another way to approach arbitrary socket numbers is for the user to attempt a connection to host at a predetermined socket, which then routes them to a new arbitrary socket that they then connect to permanently. There is a proposed “Network Directory service” that handles this routing to sockets. The scheme is admittedly “rather cumbersome”.

Socket numbers with user IDs encoded

Another way to approach socket numbers is to effectively give each user a range of available sockets that they can access. This is accomplished by giving each user a permanent ID number on the local host and hard-coding that into the most significant bits of the socket number. The idea here is increased security – for example if sockets 256 through 512 are only accessible by User A on the local computer, then User B can be sure that a request from socket 294 is definitely coming from someone logged in as User A, and can immediately reject it if it is not from the expcted range. This removes any socket conflict between users, and is more secure. But it makes things more complex for the operating system and requires the NCP to understand more about what is happening in the OS.

No sockets at all

The authors also propose a socketless scheme, where processes simply connect to processes without the intermediary of sockets. This would require a special encoding system for process numbers though.

How to follow this blog

You can subscribe to this blog's RSS feed or if you're on a federated ActivityPub social network like Mastodon or Pleroma you can search for the user “@365-rfcs@write.as” and follow it there.

About me

I'm Darius Kazemi. I'm an independent technologist and artist. I do a lot of work on the decentralized web with both ActivityPub and the Dat Project. You can support my work via my Patreon.

 
Read more...

from Daniel Rose

Photo by James Coleman on Unsplash

Fear is powerful. It generates strong emotions for fight or flight. Fear brings about not just emotional responses but physical as well. For the most part we work very hard at mitigating the fear that we feel and experience on a regular basis.

The time within which we live is filled with people telling us everything that we are afraid of or should be afraid of. Fear and promotion of fear is everywhere. It seems to be the currency by which those in power trade.

Do you want to consolidate power? Create fear.

Do you want to grasp power? Create fear.

Do you want to dethrone the powers? Be not afraid.

That’s right. You read that last bit properly. Be not afraid.

When you refuse to be afraid you don’t feed into the powers hunger for domination and control. When you refuse to be afraid you take their power from them.

It is fascinating to me that in the Scriptures there is the command, “Do not fear.” Also, when God or God’s emissaries show themselves they state, “Do not be afraid.”

God does not trade in fear.

Unlike the powers of the world, God does not leverage fear. God leverages kindness and love and mercy and grace. God invites the creation to the throne of grace to know their Creator.

The early church leader Paul writes, “Do you not know God’s kindness leads you to repentance? (Romans 2:4)”

How do we live without fear?

We acknowledge the presence of God in our midst. Not just, acknowledge but embrace, know, and experience this reality.

The prophet Isaiah writes to the people, on behalf of God, as they are on their way to exile, “So do not fear, for I am with you; do not be dismayed, for I am your God. I will strengthen you and help you; I will uphold you with my righteous hand. (Isaiah 41:10)”

If we in our time could begin to embrace the reality of the presence of God with us, in us, around us, then we might have a fighting chance to press agains the fear of the age. When fear is banished the powers lose their power. They are exposed for the emptiness and nothingness that they are.

God does not trade in fear. Neither should we.

 
Read more...

from Rodrigo Manrique

Mi disciplina Hoy en día estoy enfocado en trabajar mi disciplina.

Soy ingeniero de sistemas. Trabajo en el ámbito de la informática. Analizo datos de máquina para elaborar reportes que reflejen el estado real de la compañía. Me gusta lo que hago y me esfuerzo de hacer un buen trabajo siempre.

Paralelo a mi empleo, me dedico a escribir. Llego a mi casa de noche para sentarme frente a mi laptop y redactar. ¿Qué exactamente? Lo que sea que desee. Me apoyo de algunos foros para tener ideas, pero principalmente el resultado parte de mis experiencias.

Lo que busco es tener una respetable autoridad sobre los temas que trato: la vida, consejos, aprendizajes, errores, pensamientos, poemas.

No lucro al escribir. Y no estaría nada mal recibir algo a cambio de mis escritos. No obstante, esto empezó por pura pasión.

Nadie me presiona para hacer esto. No hay alguien que me supervise. Solo soy yo quien busca mejorar en mis técnicas de escritura. Esto es importante para mí. Esto se ha vuelto personal.

Recuerdo cuando veía personas que rondaban mi edad y que ya eran buenos en algo.

Por ejemplo, conocían muy bien una parte del mundo informático. Otros dominan el arte del canto.

Algunos eran expertos en diseño gráfico. También estaban los que dominaban la programación de sistemas.

En pocas palabras, era excelentes en lo que hacían. Además de que les gustaba, se notaba.

Yo me sentía, digamos, algo celoso. Bueno, claro que reconocía su mérito. Por supuesto que sí. Pero me preguntaba “¿en qué puedo ser bueno?”.

Me di cuenta que me había hecho la pregunta incorrecta. Por eso no tenía la respuesta tan esperada.

¿Sabes qué hice? Me pregunté “¿Qué me gusta hacer?” (totalmente diferente).

Respuesta: Hablar sobre lo que siento.

Cuando me daban la oportunidad de decir lo que siento, me percaté que hablaba con mucho detalle. Me sentía tan bien con lo que decía y el ambiente que las palabras no se me acababan.

Me sentía muy bien cuando me daban crédito por lo que decía. Algunos me agradecían por mis relatos porque coincidían con lo que ellos estaban pasando o sintiendo.

En la actualidad, le pongo mucho esfuerzo a seguir mejorando lo que siento que hago muy bien: escribir.

Es un proceso hermoso. Quisiera poder contar con lujos lo que me siento cuando la inspiración se apodera de mí. Mis manos no dejan de tipear lo que quiero decir (considero que este sea un tema para otro artículo).

Tales son las razones por las que tengo un riguroso hábito para todos los días escribir. No permito pasar un día sin hacerlo. Me considero una persona altamente disciplinada. Busco demostrarme que puedo seguir creciendo.

Como dije, nadie me supervisa, nadie me presiona. No es un decreto de mi empresa. Es una meta personal impuesta por mí mismo.

¿Sabes qué es lo mejor de todo?

Cuando trabajas deliberada y meticulosamente en ti, no solo te vuelves un contribuidor con tu propio futuro, sino también contribuyes a la vida de personas cercanas a ti.

De eso se trata todo. No termina el viaje al mejorar tu vida. Esa es la primera parte de la travesía. Lo que sigue es repartir esos dones al mundo. Es un hecho que existen más de una persona que necesita de tus habilidades, de tu talento.

Por eso tengo un mantra, uno poderoso que me permite seguir haciendo lo que hago:

“Si tienes un talento, sería un crimen no mostrárselo al mundo.”

 
Leer más...

from bsmall2 Learning Racket

Inspired by a Diaspora* post about simple gui programming in Red , I played with gui programming in Racket. Just a few tweaks to the example in Racket's Windowing documentation(fn:2) and a button in a frame shows an insult. Gui programming seemed too complex too learn, but the Red example got me over the off-putting idea. For some tasked, gui-programming might be simpler and shorter than generating html pages.

The code and .csv data are below

I want to find a way to do poster-style presentations with Racket. I've been experimenting with slideshow and pict hoping to discover an alternative to Inkscape/sozi and Impress.js with refocus and panorama. I never got to use Inkscape/JessyInk but I think the pict/conditional language(module?) with ghost and other functions make JessyInk-like presentations possible in a relatively straightforward way. But I want to discover a D.R.Y. approach to using an A4 printout as a focus for discussion. With Inkscape it's interesting to layout an A4-sized paper with text and images (plots). Exporting Inkscape's .svg file to .pdf lets me print a page, and then using sozi lets me focus a screen on different parts of the page. But it's awkward to replace images and edit text in Inkscape. It would be great to have Racket generate the page sand screen presentation from easily editable text files and easily replaceable image files.

But I still can't imagine a manageable way to generate the printed page and sozi presentation with pict and slideshow. Even just the Impress.js style presentation seems complex with pict... Maybe reading the Racket documentation for gui programming will give me some ideas....

code .rkt

#lang racket/gui

;; GUI setup prep:
(define frame (new frame% [label "Shakespeare-style Insults"]
                  (min-width 600)))

;;; get insult ready
(define (str->path str)
  (build-path (current-directory-for-user) str))

(define (get-lines str)
  (define inp (open-input-file (str->path str)))
  (define lines (port->lines inp))
  (close-input-port inp)
  lines)

(define text-file-lines
  (get-lines "Shakespeare-Insult-Columns-3.csv"))

(define (csv-lines->lists lines)
  (map (lambda (l) (string-split l ",")) lines))

(define insult-lists
  (csv-lines->lists text-file-lines))

(define (get-random-list-element lst)
  (list-ref lst (random (length lst))))

(define (generate-insult insults)
  (string-append "You "
		 (string-join
		  (list
		   (first (get-random-list-element insult-lists) )
		   (second (get-random-list-element insult-lists) )
		   (third (get-random-list-element insult-lists)))
		  " ")
		 "!"))

;  GUI setup: Make a button in the frame 
(new button% [parent frame]
             [label "Insult Me!"]
             ; Callback procedure for a button click:
             [callback (lambda (button event)
                         (send msg set-label ; "Insult Time!"
                              (generate-insult insult-lists)
                              
                              ))])

; Make a static text message in the frame
(define msg (new message% [parent frame]
                          [label "Click Button for a Shakespearean Insult"]))
 

 
; Show the frame by calling its show method
(send frame show #t)

data .csv

artless,base-court,apple-john
bawdy,bat-fowling,baggage
beslubbering,beef-witted,barnacle
bootless,beetle-headed,bladder
churlish,boil-brained,boar-pig
cockered,clapper-clawed,bugbear
clouted,clay-brained,bum-bailey
craven,common-kissing,canker-blossom
currish,crook-pated,clack-dish
dankish,dismal-dreaming,clotpole
dissembling,dizzy-eyed,coxcomb
droning,doghearted,codpiece
errant,dread-bolted,death-token
fawning,earth-vexing,dewberry
fobbing,elf-skinned,flap-dragon
froward,fat-kidneyed,flax-wench
frothy,fen-sucked,flirt-gill
gleeking,flap-mouthed,foot-licker
goatish,fly-bitten,fustilarian
gorbellied,folly-fallen,giglet
impertinent,fool-born,gudgeon
infectious,full-gorged,haggard
jarring,guts-griping,harpy
loggerheaded,half-faced,hedge-pig
lumpish,hasty-witted,horn-beast
mammering,hedge-born,hugger-mugger
mangled,hell-hated,joithead
mewling,idle-headed,lewdster
paunchy,ill-breeding,lout
pribbling,ill-nurtured,maggot-pie
puking,knotty-pated,malt-worm
puny,milk-livered,mammet
qualling,motley-minded,measle
rank,onion-eyed,minnow
reeky,plume-plucked,miscreant
roguish,pottle-deep,moldwarp
ruttish,pox-marked,mumble-news
saucy,reeling-ripe,nut-hook
spleeny,rough-hewn,pigeon-egg
spongy,rude-growing,pignut
surly,rump-fed,puttock
tottering,shard-borne,pumpion
unmuzzled,sheep-biting,ratsbane
vain,spur-galled,scut
venomed,swag-bellied,skainsmate
villainous,tardy-gaited,strumpet
warped,tickle-brained,varlot
wayward,toad-spotted,vassal
weedy,unchin-snouted,whey-face
yeasty,weather-bitten,wagtail

  • About this code/post: Diaspora* post

footnotes

#racket #DrRacket #Shakespeare #gui #LearningProgramming

 
もっと読む…

Join the writers and thinkers on Write.as

Start writing or create a public blog