Home Menu ↓

Blog

Fledge

Introducing Fledge, a file processing language/shell written in Python. I wrote it for two reasons: first, as an experiment with an idea that I’ll explain in a moment, and second, because I can’t for the life of me ever remember how to do batch find-and-replace in text files on the command line. (And yes, I could have written a script to help me with the latter. In fact, I did. I just can’t ever remember what it’s called. I … may have issues.)

Anyway, the idea is that you select the files first, then execute one or more actions on them, rather than the normal way round. For example:

with my-book.text
split on /CHAPTER/ to chapter-%%.text
replace /CHAPTER/Chapter/
trim

That splits my-book.text out on a regex to chapter-01.text, chapter-02.text, etc., does a batch find-and-replace on all those chapter files, and then trims them of whitespace at the beginning and end of each file. The alternative would be something like this, assuming you had split, replace, and trim scripts:

$ split my-book.text "/CHAPTER/" "chapter-%%.text"
$ replace chapter-*.text "/CHAPTER/Chapter/"
$ trim chapter-*.text

So, instead of having to specify which files you’re working on at every step of the way, with Fledge you just do it at the beginning and that selection is used for whatever subsequent actions you perform.

Some more examples

with *.jpg where size != 0
rename page-%%%.text starting with 0

This gets all the non-zero image files in the directory and renames them sequentially to page-000.jpg, page-001.jpg, etc.

alias {mtp} ~/Documents/mtp
with **/*.jpg
convert to png
deselect DSC*
move to {mtp}

This finds all the JPEG files recursively under the current directory, converts them to PNG, deselects everything that starts with DSC, and moves the rest of the PNGs to ~/Documents/mtp.

More about Fledge

The fl script can either execute a script of Fledge actions contained in a file or, if you run it without arguments, it loads an interactive shell.

There are a number of built-in Fledge actions (listed in the README), mostly geared towards working with text and image files, but you can write custom actions (which live in ~/.fledge/actions) to do pretty much anything. (Keeping in mind that in general these would be things you want to do to a large number of files.)

How I’m using it

I use it to help prep image scans of journals and personal histories and stuff to upload to Unbindery for transcription (which, incidentally, I’ve been thinking about paring down to a much simpler, more focused app aimed at family history transcription). I also use it for ebook production (splitting Project Gutenberg files into chapters to be made into EPUBs, doing batch substitutions, etc.) and for Mormon Artist (resizing and renaming images, mostly).

So far, I like it. It’s still very much a work in progress (as I write this I’m realizing rename probably should be rename to for consistency), but I can actually remember these commands. And for situations where I’m doing a lot of sequential actions on multiple files (as in ebook production), it’s nice not having to re-specify everything every step.


Reply via email

Why I believe: Good and evil

This essay is part of a series called Why I Believe.

I initially thought I could knock this essay off in half an hour or so, but it has proven to be somewhat more knotty than that, mostly in figuring out what I actually think since I haven’t spent as much time pondering this as I have with the other topics.

I’m starting this series off with good and evil — morality — because these principles are foundational. If they don’t exist, everything else crumbles.

The meaning of morality

As humans, we have this thing called behavior: we think, we speak, we do. We make choices, hundreds or more each day. We make things happen, on a dizzyingly wide spectrum from very small things to massive, world-changing things. Now, things happen in the natural world as well — the sun rises, water flows, gravity pulls, trees grow, animals eat and mate and die. The difference is that we humans classify our behavior on a scale of good and evil. We have consciences.

Much human behavior is neutral — choosing between two brands of bread at the grocery store, to pick a mundane example — and the actions of both animal and nature also seem to be neutral. Is it good when a rock falls down a cliff? Is it evil when the wind blows the leaves off a tree? It seems to me that the closer animals get to humans in behavior and form, the more we project our morality onto them — a chimpanzee beheading and eating its offspring strikes me as far more horrifying than an ant doing the same — and yet it all appears to be just projection, anthropomorphizing as we tend to do. Animal behavior isn’t good or evil. Those classifications are reserved for humans alone.

What, then, are good and evil? They are the two halves of a scale upon which we measure our thoughts, words, and actions. Intriguingly, you need both for either to make any sense; without good, there is no evil, and vice versa. (Lehi said this more eloquently.)

So, we have this concept of morality. It leads to a number of other questions: whether the definition of the scale is up to us, for example, and whether such a scale should inform our behavior.

The definition of the scale

Are we making this stuff up? That’s the question. I wrestled with this for a while and I don’t know that I have a solid answer yet, but I find that it’s easier for me to look at it from the inverse: does moral relativism make sense?

First, some terms kifed from Wikipedia: descriptive moral relativism is the idea that people see morality differently. Next, meta-ethical relativists believe that “good” and “evil” are relative to the traditions or beliefs of an individual or group. Finally, normative relativists go a step further and believe that we ought to tolerate others’ behavior regardless of whether it falls under our “evil” or not.

Descriptive relativism is of course quite true — there is, to understate it, a difference of opinion on what is good and what is not, across cultures and time. But then again is there really as much of a difference as we might think? Most religious traditions generally agree on what is good — helping others, being kind, etc. — and what is evil — lying, stealing, hurting, killing, etc.

Because of that (among other things), meta-ethical relativism doesn’t ring true to me. There does seem to be an underlying foundation of morality that is universal. Interpretations of it may differ, and we almost always stack our own extra cultural made-up rules on top of it, but there’s something there, something beyond our making. More on that in a moment.

Normative relativism is just ridiculous (and its minions are thankfully few). By its standard, we should tolerate an individual raping, murdering, and eating a child. But that “should” is problematic by their own standards because it attempts to prescribe the normative relativists’ standard of good (toleration of all behavior) onto other people whose standards of good are different (toleration of only some behavior).

The next question is whether this universal morality is just a byproduct of evolution. To my understanding, this would mean that being “good” would help you live longer and make more posterity (life must go on). “Good” would mean maintaining a healthy relationship with those around you — knitting societies together — for greater protection against danger and for a greater chance at reproductive success. A lot of the human behavior we classify as good makes sense under this rubric, but some of it doesn’t — for example, it doesn’t explain why we consider it good and noble for someone to lose their life saving that of a perfect stranger.

So, as I’ve found moral relativism lacking in substance, and as evolution doesn’t quite explain morality to my satisfaction, I find it easier to believe that this universal morality comes from outside of us humans, namely from God.

Whether it matters

If there is in fact a standard of good and evil, and if it’s something real outside ourselves and not just whatever we want it to be to suit our convenience, then yes, of course morality matters. Some ramifications:

First, we ought to know what the standard is — what is good and what is evil. This requires going to the source of the standard, rather than relying on flawed, distorted human interpretations of it.

Second, we ought to listen to our consciences. We all seem to have one (the exceptions are rare enough that we won’t consider them here), and that conscience urges us to choose good over the evil that we naturally tend to choose.

Third, we ought to relentlessly strive to ensure that all our behavior is good and not evil, for our own sake and for the good of those around us (because it’s good to care about others’ needs above our own). When we do think, say, or do evil things, whether small or large, we ought to stop and never do it again, and fix whatever mess we’ve made.

Conclusion

This wasn’t quite as personal as I’d hoped it would be, but I suppose that’s part of talking about things this way, aiming for objectivity instead of subjectivity (if that’s at all possible). Let me just say that beyond all this, the idea of good and evil resonates with me, especially as I look at my thoughts, words, and actions. I can see how what I do has an effect for good or ill on myself and on those around me. It makes sense.

With that foundation, we can now move on to the source of this standard of good and evil: God.


Reply via email

Some thoughts on prayer

I don’t know why it never occurred to me before (because it’s rather obvious in retrospect), but this morning I realized that closing our eyes when we pray has a purpose beyond just showing respect for God and being the way we’ve always done it, a purpose I’d forgotten till today: focus.

Closing our eyes shuts out visual signals, getting rid of most external distractions. With the visuals out of the way, our ability to listen — physically, but hopefully spiritually as well — seems to get amplified. And then we can work on clearing our minds of internal distractions as well.

Without my noticing, I’ve recently been subconsciously discounting the physical aspects of prayer — closing your eyes, kneeling, folding your arms or clasping your hands — as being less necessary, but I see now that I’ve been wrong. These physicalities of prayer are in fact essential to good praying — to communing with God in a meaningful, sustaining way and not just mentally dictating a quick memo to him. (And yes, in some situations the physical aspects aren’t possible — closing your eyes and kneeling while driving a car would fall under the “Not Very Wise” category of things to do. I suppose you would get to meet God face to face fairly quickly, though…)

Also, creating this meditative environment for prayer, along with staying on your knees afterward to listen, is a great antidote for Internet ADD.


Reply via email

Shortform initial draft

After blogging that Shortform mockup, I kept finding myself needing the app itself, so I went ahead and started writing it. It’s very much a draft and not polished, but the core is there, and it’s usable enough that I turn to it quite often.

What’s working

  • You can create notes.
  • Notes are autosaved to a folder specified in preferences.
  • Notes are reopened when you open the app, like with Stickies.
  • User-customizable global hotkeys (using MASShortcut):
    • Show app
    • Create new note
    • Create new note with the contents of the clipboard

What’s not implemented yet

  • Console. I made a first failed attempt (which messed all the window layout up) and need to try again.
  • Title bars. I’ve decided I don’t actually want them — they look nice, but since you can drag a note using the margin on any side of the window, and since you can use keyboard shortcuts or the menu item to close the current note, the title bars aren’t really necessary.
  • Preview mode.
  • Themes.

Note that this is my first OS X app, so I’ve undoubtedly flubbed a number of things. But I do have to say that Cocoa is a very nice framework to work with — I was able to get to this point far more quickly than I expected to. And Objective-C is — dare I say it — growing on me a little.


Reply via email

Why I believe: Introduction

At the request of one of my friends, I’ve been writing down the reasons I believe in the Church from a rational, intellectual perspective. I’ve decided to post those reasons here as a series of short essays, mostly to help me clarify my thoughts.

First, a disclaimer: these are not rigorous mathematical proofs. They are crutches I use to think things through when I’m not as spiritually in tune as I ought to be, a way to silence the occasional doubts so that I can see clearly again. They work for me, but they won’t be convincing for everyone. It’s also possible that they are convincing only to me. Keep in mind, too, that my main reason for belief is feeling the touch of God upon my mind and heart — numinous, spiritual experiences throughout my life. Aesthetics are also part of it, and I hope to touch on that as well. Logic is very much a part of my thought patterns and my beliefs, but it’s not the backbone of my testimony.

Disclaimer about the disclaimer: I’m not saying that doubts come about because of being spiritually out of tune. It does seem to be the case in my own life (usually when my scripture study gets too casual and skimpy), but I don’t think I can generalize beyond that.

With that introduction, then, here is the tentative outline for the series (I’ll update this page with links to the essays as I post them):

  1. Good and evil
  2. Heavenly Father
  3. Christ
  4. Prophets
  5. Joseph Smith
  6. Book of Mormon
  7. The modern Church

If any of you have specific topics or issues you’d like me to cover, let me know.


Reply via email

Mormon Texts Project’s new home

I’m happy to announce that the Mormon Texts Project lives on, now under the care of Tom Nysetvold. They’ve already posted a couple new Mormon ebooks to Project Gutenberg, too. I wish them the best.


Reply via email

General conference reading tracker

I’ve been trying to do a better job of rereading the conference talks between conferences. Since I skip around and don’t read talks in sequence, however, it’s been hard to tell which talks I’ve already read and which I haven’t. So, in nerdy fashion, here is a chart (you knew it had to be a chart) to give me nice little checkboxes I can fill in.


Reply via email

Experimental pedigree chart

Because I apparently can’t stop making genealogy charts: here’s a pedigree chart I put together as an experiment to see what things would look like if the more recent names were larger. The result:

I do like the larger names, but it seems that on the left side of the chart the hierarchy is harder to read. This kind of chart might work better with just four generations instead of six.


Reply via email

Picture book templates

I’ve started work on a picture book, and me being me, I ended up making some storyboarding templates. Currently there are PDFs for 24- and 32-page square books.

(And yes, this is one way I’m avoiding work on the actual book.)


Reply via email

Teach Me to Walk in the Light

I’m contributing occasional artwork to the Beesley Project, a yearlong exploration of the LDS hymnbook (doctrinal/lyrical analysis, etc.). This piece accompanied Jen Bosen’s essay.

Painted in Photoshop.

Reply via email