Wednesday, April 3, 2019

Lawyering in Linux - E-signing a PDF

I had the need the other day to e-sign a PDF that I hadn't myself generated. If I had generated the PDF, I could have easily stuck in the /s/ line myself on the signature line.

Luckily I had two great FLOSS tools to help: PDFtk and LibreOffice. The heavy lifting is done with pdftk and its multistamp operation. In my case, I had a 9-page PDF with signature lines on page 3 and page 9, so this is what I did:

  1. Determine the pages and locations on each page where you need to add text (in this case, a signature) (you can also add images). I went ahead and printed out the two pages I needed and used a ruler, but you can eyeball it to start, because you're likely to need to iterate anyway.
  2. Create a Writer document in Libreoffice. You can typically use libreoffice --writer to do this.
  3. Generate enough page breaks to match the number of pages in the PDF file. If you have a LOT of pages, you might consider using pdftk to break up your PDF into individual pages, and process each page separately. That exercise is left to the reader.
  4. On each page that needs, e.g., a signature line: create a table with two columns and two rows. Size the row height of the top (or bottom) row to get the other row in place. Then size the left (or right) column width to get the right cell into place. Make sure you uncheck "fit contents" so the row doesn't auto-resize.
    • If you need more elements on the page, add more tables. You can put tables inside tables if you need to. Or, you can use frames or other elements to put text on the page.
    • Don't forget to put your text and/or image into the correct cell!
  5. Save the Libreoffice document as a PDF.
  6. Use pdftk {PDF to sign} multistamp {PDF of signature(s)} output {Signed PDF} to sign the PDF. The output will have the name you gave to {Signed PDF}.
  7. Pretty likely, this won't work the first time. So go back to step #4 and adjust your row and column sizes, or frame positions, or whatever, and try again. I think it took me 3 iterations.
There you go - your text and/or other elements will now be stamped on the PDF you inherited.

You might also take a look at  stamptk in case that meets your needs! Keep in mind, though, that stamptk is a proprietary program, not FLOSS.

Monday, April 7, 2014

Modifying free software

I use the Debian distribution of GNU/Linux on various machines at home and at work. I've been using this distribution since the 1990s, and have been keeping it upgraded over various versions, so my configuration on my laptop has become increasingly customized and comfortable. I'm currently using the squeeze version (with some backports from wheezy). For a graphical user interface, I use XFCE4, version 4.6.2; the latest stable version available through Debian is 4.8. One of the nice things about this version is that it allows me to visually monitor my machine's performance as part of a panel, using a GNOME applet called "system monitor"; this GNOME applet integrates with XFCE via a bridge piece of software called xfapplet.

Note that I'm "one version behind" for both the Debian and XFCE projects. The reason I'm not upgrading either set of software is because the xfapplet bridge that allows me to use GNOME system monitor does not exist in these new versions. I have heard that GNOME has been changed dramatically in its new release (going away from "applets" and using a new paradigm called "indicators"); this may make it difficult for the maintainers of xfapplet to upgrade it to the new versions of GNOME and XFCE.

My solution is to make my own version of the parts of GNOME system monitor that I use. I will start with the excellent xfce4-cpugraph-plugin applet. From there, I intend to make two sets of changes:

  1. Modify xfce4-cpugraph so it shows different colors for each type of CPU used. This will allow a user to tell, at a glance, how much CPU time is spend in the following modes: user, system, nice, IOwait.
  2. Clone the modified xfce4-cpugraph to monitor memory (user, shared, buffer, cached); network (in, out, local); swap space (used/free); system load (moving average); hard disk usage (read, write). Each of the graphs will stand alone as its own plugin, so I'd end up with xfce4-memgraph, xfce4-netgraph, xfce4-swapgraph, xfce4-loadgraph, and xfce4-diskgraph. Users can chose whatever combination of monitors they'd like to install in their xfce4-panel. I may disable the "bars" on the cloned versions of the graphs; I certainly wouldn't be using them.

One caveat: the current plugins are designed to work not only on Linux but on various other operating systems that XFCE works on: FreeBSD, NetBSD, OpenBSD, and Sun/Solaris. I am not going to make the "clone" plugins work on any kernel other than Linux. Also: I plan to modify the upstream code in the XFCE repository, not the Debian package. I may be able to help the Debian maintainer package the projects, if that helps.

Want to help? Please let me know.

Tuesday, April 1, 2014

I passed the bar exam!

After four years of school, five months of studying, three days of exam, and lots of life in between, I passed the Texas Bar exam. That is a BIG relief.
I actually can't even put that feeling into words.

Monday, March 31, 2014


I brewed ales and meads with a group of friends for about two years, starting twenty years ago. I stopped after a while; friends moved away, and it just didn't fit into my schedule for a while. I'm pretty happy to be starting back up.

This weekend I brewed two fermented beverages: a mead (technically metheglin: fermented honey, ginger, and cinnamon), and a porter ale. The latter is a dark ale with moderate bitterness, and was the source of some trouble. I was up until 4am nursing a cranky batch of beer, and my bathroom is currently (pleasantly) scented with the aroma of hops and barley.

The porter I brewed, like most ales, is made of water, sugars and starches from malted barley, and hops (for flavoring and preservation). This concoction is called the wort. When the wort is cool, yeast is added; the yeast will convert most (sometimes all) of the sugars into alcohol. The hops release their oils during the boiling process; these oils impart flavor to the finished beer. The yeast, as part of its fermentation process, generates carbon dioxide as a byproduct.

This fermentation process usually takes place in a carboy:
picture of carboy. At the top of the carboy in the picture, you can see what's called an air-lock; this allows the carbon dioxide to escape, and prevents oxygen (and anything else) from coming into the carboy. When things are going well, the air-lock will make a bubbling sound, often about once per second (sometimes more frequently, especially at the beginning, and sometimes less frequently, as the sugars are converted). If the carbon dioxide cannot be released, the air-lock may be expelled rather forcefully from the carboy. While the wort is fermenting, heavy particles sediment out to the bottom (the trub), and lighter particles and oils rise to the top (kraeuzen).

It was the kraeuzen, the bitter oils and particles, that clogged up my air-lock on the porter. I returned home from an evening out, to find the air-lock across the room, and kraeuzen all over the carboy. I attached a blow-off tube to the air-lock's stopper, and allowed the kraeuzen to continue to bubble out overnight; when I finally heard it start bubbling steadily (around 4am), I was able to re-sanitize the air-lock, and attach it back to the carboy.

Because there was steady fermentation the whole time, I'm pretty sure there was positive pressure heading out of the carboy at all times; I'm pretty sure no contaminants entered during the process. Nevertheless, I'm going to keep my eye on it pretty closely over the next few days.

If you have any questions about brewing or any recipes, please ask!

Monday, March 24, 2014

What I'm glad I did in law school

I don't want to post ad nauseum about the bar exam and my law school experience. I'm also not representing this as "how to pass the Texas bar exam" because for all I know at this point, I've not yet accomplished that. Instead, here are some classes I'm glad I took, and experiences I found relevant, once I started the bar review process.

For the MPT

The MPT is an exercise in which you are given a packet with some made-up court cases, made-up law(s), made-up facts, and a task, usually to write a memo or some persuasive brief. In my opinion, this is probably the most valuable part of the bar exam, especially for potential solo practitioners; it simulates what you'd have to do to come up to speed quickly in an unfamiliar area of the law in order to solve a problem for a client. I'm really glad I took an extra research and writing course, a course in "advocacy" (at the appellate level), and I interned with an appellate court. Other things that might be good for this exercise might be to clerk for a law firm, and to compete in mock trial or moot court competitions where you need to do more research and writing.

Interestingly, and just by chance, I found my internship with an immigration lawyer particularly relevant during this part of the bar exam; the specific task I had on my MPT was to write a brief in support of a client who was trying to show his marriage was bona fide for immigration purposes. It was nice to feel familiar at least with this area of law, even though all the court cases and statutes were made-up.

For the MBE

The MBE is a (pretty difficult) multiple-choice examination covering the basic topics you learn as a first-year student (1L). I'm really glad I took additional courses in Evidence and Criminal Procedure. That pretty much rounded out the topics on the MBE for me. I also apparently had pretty broad-ranging classes in Real Property and Torts as a 1L; often, when the review professor in those areas said "You probably didn't cover this in your 1L class", it wasn't true for our class.

Other than that, I found it really helpful to do lots and lots of practice questions, and then to review the ones I got wrong. A small number I got wrong more than once, which was embarrassing, especially because I probably got those wrong on the bar exam as well. Oh well.

For the Texas Procedure and Evidence short-answers

The Texas bar exam asks 20 questions about criminal procedure and evidence, and 20 questions about civil procedure and evidence. Each question is answered in up to 5 lines of handwritten text. I was pretty happy again for having taken Evidence as well as Criminal Procedure. I have the feeling (and no first-hand experience to back it up!) that participating in mock trials, trial advocacy training, and as an intern in a trial court or district attorney's office would be helpful here too.

For the Texas subject exams

The Texas subject exams are 12 essay questions over two three-hour sessions. Just doing that much writing was pretty exhausting. The subject areas were pretty broad, too.

During the bar review, I was again pretty thankful for my 1L class in Real Property because we covered topics such as landlord/tenant law. I'm also glad I took Family Law, Trusts and Wills, Federal Income Tax, Business Organizations (which included a chapter on Agency), and Texas Consumer Law. Because I took those classes, those sections of the bar review were truly review for me.

Areas I didn't take classes in were Oil and Gas, Guardianship, Secured Transactions, and Commercial Paper. I found those pretty easy to pick up, partly because I found them pretty mechanical, and partly because I could focus on them and just review the other subjects.

If your school offers bar prep classes, such as for the MPT, you might consider taking them. On the other hand, I really can't imagine taking the bar exam without taking a bar reivew/prep course, so if you are sure you will take a review course anyway, then maybe you should take more substantive courses during your time at law school. If you've got the resources, it might not hurt to start practicing MBE questions with an online question bank "ahead of time", maybe during your 3L year, especially if you feel comfortable already with Evidence and Criminal Procedure. If don't already know those areas, then wait for the review course to teach you the basics in those subjects, because otherwise the review questions are likely to be frustrating.

One last thing. I ended up choosing to hand-write my exams, mostly because I'd already seen the bar exam software freeze up or fail for various classmates during final exams at law school (in fact, it even happened to me once). Although I still wonder if that were the right decision, I doubt it made much of a difference. I would have been better served doing a lot more hand-writing practice during the bar review process; most of the practice was online and typed, which was a very familiar environment. Time management is different when you hand-write, at least for me; I can type 80-90 words a minute, and certainly can't write that much. I think my hand-written essays were a bit shorter than typed ones would have been. In the end, it doesn't matter as long as I pass the bar exam; I wasn't going to get the top score even by typing, so unless hand-writing put me below the passing grade, I'm okay. Just saying if you make that choice for taking the bar exam, you might consider practicing time management while writing lots and lots of essays over a six-hour stretch.

Monday, March 10, 2014

Schrödinger's Lawyer

Well, I just finished taking the February 2014 Texas Bar Exam. I'm in a strange quantum state between lawyer and non-lawyer; I feel a bit like Schrödinger's cat. The Board of Law Examiners (BLE) has my completed exam; it's sufficient to determine if I'm eligible for admission to the State Bar of Texas. The BLE will collapse that wave function when they open, grade, and scale/curve the exam. The function won't collapse for me or anyone else until May 1, 2014, when the results are announced.

There was a really interesting article in Scientific American about the relational interpretation of quantum mechanics; unfortunately, this article is now behind a paywall. What makes this interpretation so compelling to me was the confirmation that the cat knows the outcome before the box opens. Each potential observer has their own wave function; an observation event by that observer collapses the potential states of the system into an observed state for that observer. Much as the special theory of relativity describes how different observers in different accelerating frames may perceive sequences of events differently, this theory of quantum mechanics eschews a single, canonical wave function and "collapse". To me, discovering the relational theory was so freeing; the "objective" theories, including even the quite compelling "many worlds interpretation" with its infinite alternate universes (based on what quanta??), seemed to require too much compromise.

Thursday, March 31, 2011

The sleep needs of adolescents

HISD is considering moving HS start times EARLIER next year (look down toward the middle). But recent research implies that high school students do better later in the day; apparently puberty shifts the 'chronotype' of adolescents to an 'evening preference'. Some districts have shown improvement in student participation and behavior with later times. Other studies have shown a correlation between sleep deficit and reduced creativity and performance.

Of course changing start times for high school students also impacts school faculty and staff, and parents and families. Students may find it difficult to have after-school jobs, long extra-curricular activities, or away-games against schools in other districts. Nevertheless, it appears that with enough planning, the overall effects can be positive for all involved.

I recommend you read the article from the March 2011 issue of "Educational Researcher." Some of the references in the article may be available online if you can't get the link above; please see below.

  • Black, S. (2000). A wake-up call on high-school starting times. Education Digest, 66(4), 33–38.
  • Blatter, K., & Cajochen, C. (2007). Circadian rhythms in cognitive performance: Methodological constraints, protocols, theoretical underpinnings. Physiology and Behavior, 90, 196–208.
  • Bonnet, M. H. (2000). Sleep deprivation. In W. C. Dement (Ed.), Principles and practice of sleep medicine (3rd ed., pp. 53–71). Philadelphia: Saunders.
  • Cajochen, C., Blatter, K., & Wallach, D. (2004). Circadian and sleep-wake dependent impact on neurobehavioral function. Psychologica Belgica, 44, 59–80.
  • Cajochen, C., Khalsa, S. B., Wyatt, J. K., Czeisler, C. A., & Dijk, D. J. (1999). EEG and ocular correlates of circadian melatonin phase and human performance decrements during sleep loss. American Journal of Physiology, 277, 640–649.
  • Carskadon, M. (1999). When worlds collide: Adolescent need for sleep versus societal demands. Phi Delta Kappan, 80(5), 348–353.
  • Carskadon, M. (2002). Adolescent sleep patterns: Biological, social, and psychological influences. Cambridge, UK: Cambridge University Press.
  • Carskadon, M. A., & Acebo, C. (2005). Intrinsic circadian period in adolescents versus adults from forced desynchrony. Sleep, 28(Abstract supplement):A71.
  • Center for Applied Research and Educational Improvement. (1998a). School start time study. Final report summary.
  • Center for Applied Research and Educational Improvement. (1998b). School start time study. Technical report: Vol. II. Analysis of student survey data.
  • Chandler, M. A. (2009, January 6). Fairfax plan would delay high school start at no cost. Washington Post.
  • Crowley, S. J., Acebo, C., & Carskadon, M. A. (2007). Sleep, circadian rhythms, and delayed phase in adolescence. Sleep Medicine, 8, 602–612.
  • Dahl, R. E. (1999). The consequences of insufficient sleep for adolescents: Links between sleep and emotional regulation. Phi Delta Kappan, 80, 354–359.
  • De Gennaro, L., Ferrara, M., Curcio, G., & Bertini, M. (2001). Visual search performance across 40 h of continuous wakefulness: Measures of speed and accuracy and relation with oculomotor performance. Physiology and Behavior, 74, 194–204.
  • Dement, W. C., & Vaughan, C. (1999). The promise of sleep: A pioneer in sleep medicine explores the vital connection between health, happiness, and a good night’s sleep. New York: Delacourt.
  • Dinges, D. F., & Kribbs, N. B. (1991). Performing while sleepy: Effects of experimentally-induced sleepiness. In T. H. Monk (Ed.), Sleep, sleepiness and performance. Human performance and cognition (pp. 97–128). Oxford, UK: John Wiley.
  • Edgar, D. M., Dement, W. C., & Fuller, C. A. (1993). Effect of SCN lesions on sleep in squirrel monkeys: Evidence for opponent processes in sleep–wake regulation. Journal of Neuroscience, 13, 1065–1079.
  • Fischer, F. M., Radosevic-Vidacek, B., Koscec, A., Teixeira, L. R., Moreno, C. R., & Lowden, A. (2008). Internal and external time conflicts in adolescents: Sleep characteristics and interventions. Mind, Brain, and Education, 2, 17–23.
  • Giannotti, F., Cortesi, F., Sebastiani, T., & Ottaviano, S. (2002). Circadian preference, sleep and daytime behaviour in adolescence. Journal of Sleep Research, 11, 191–199.
  • Kirby, M., & D’Angiulli, A. (2009). Timing (not just amount) of sleep makes the difference: Event-related potential correlates of delayed sleep phase in adolescent female students. In N. A. Taatgen & H. van Rijn (Eds.), Proceedings of the 31st Annual Conference of the Cognitive Science Society. Austin, TX: Cognitive Science Society.
  • Kryger, M. H., Roth, T., & Dement, W. C. (Eds.). (2000). Principles and practice of sleep medicine (3rd ed.). Philadelphia: W. B. Saunders.
  • Kubow, P. K., Wahlstrom, K. L., & Bemis, A. E. (1999). Starting time and school life: Reflections from educators and students. Phi Delta Kappan, 80, 366–371.
  • May, C. P. (1999). Synchrony effects in cognition: The costs and a benefit. Psychonomic Bulletin and Review, 6, 142–147.
  • May, C. P., Hasher, L., & Foong, N. (2005). Implicit memory, age, and time of day: Paradoxical priming effects. Psychological Sciences, 16, 96–100.
  • Millman, R. P., Working Group on Sleepiness in Adolescents/Young Adults, & AAP Committee on Adolescence. (2005). Excessive sleepiness in adolescents and young adults: Causes, consequences, and treatment strategies. Pediatrics, 115, 1774–1786.
  • Mitru, G., Millrood, D. L., & Mateika, J. H. (2002). The impact of sleep on learning and behavior in adolescents. Teachers College Record, 104, 704–726.
  • National Sleep Foundation. (2005a). Changing school start times: Arlington, Virginia.
  • National Sleep Foundation. (2005b). Changing school start times: Denver, Colorado.
  • National Sleep Foundation. (2005c). Changing school start times: Fayette County, Kentucky.
  • National Sleep Foundation. (2005d). Changing school start times: Jessamine County, Kentucky.
  • National Sleep Foundation. (2005e). Changing school start times: Wilton, Connecticut.
  • National Sleep Foundation. (2006). Sleep in America Poll.
  • Noland, H., Price, J. H., Dake, J., & Telljohann, S. K. (2009). Adolescents’ sleep behaviors and perceptions of sleep. Journal of School Health, 79, 224–230.
  • Owens, J. A., Belon, K., & Moss, P. (2010). Impact of delaying school start time on adolescent sleep, mood, and behavior. Archives of Pediatrics and Adolescent Medicine, 164, 608–614.
  • Petros, T. V., Beckwith, B. E., & Anderson, M. (1990). Individual differences in the effects of time of day and passage difficulty on prose memory in adults. British Journal of Psychology, 81, 63–72.
  • Schmidt, C., Collette, F., Cajochen, C., & Peigneux, P. (2007). A time to think: Circadian rhythms in human cognition. Cognitive Neuropsychology, 24, 755–789.
  • Taylor, D. J., Jenni, O. G., Acebo, C., & Carskadon, M. A. (2005). Sleep tendency during extended wakefulness: Insights into adolescent sleep regulation and behavior. Journal of Sleep Research, 14, 239–244.
  • Wahlstrom, K. (2002). Changing times: Findings from the first longitudinal study of later high school start times. NASSP Bulletin, 86(633), 3–21.
  • Wahlstrom, K. (2010). School start time and sleepy teens. Archives of Pediatrics and Adolescent Medicine, 164, 676–677.
  • W.A.K.E.: Worried About Keeping Extra-curriculars. (n.d.). Disruptions.
  • Wright, K. P., Jr., Gronfier, C., Duffy, J. F., & Czeisler, C. A. (2005). Intrinsic period and light intensity determine the phase relationship between melatonin and sleep in humans. Journal of Biological Rhythms, 20, 168–177.
  • Wrobel, G. D. (1999). The impact of school starting time on family life. Phi Delta Kappan, 80, 360–364.
  • Yoon, C., May, C. P., & Hasher, L. (1999). Aging, circadian arousal patterns, and cognition. In D. Park & N. Schwartz (Eds.), Cognitive aging: A primer (pp. 151–170). Philadelphia: Psychology Press.

Sunday, March 13, 2011

Distinguishing Snyder from Rosenbloom

University of Houston Law Center's Professor Leslie Griffin of the Religion Rogue blog analyzes the recent Supreme Court decision in Snyder v. Phelps in the context of an earlier case, Rosenbloom v. Metromedia. Professor Griffin suggests the Court may be moving toward a Free Speech analysis suggested by Justice Brennan in Rosenbloom, which protects speech about matters of "public concern" even when it causes harm to private individuals. I believe that Chief Justice Roberts's opinion in Snyder is written in such a way that its analysis is distinguishable from Justice Brennan's.

The speech in Rosenbloom which Justice Brennan suggested was protected was about Rosenbloom himself; he was described as "a main distributor of obscene material in Philadelphia." I believe that stands in contrast to the facts considered important by the majority in Snyder. As Justice Alito points out in Part IV of his dissent, the majority first confines their analysis to the placards at the funeral, putting aside the events before and after (which included a press release and an internet "epic"). Even in that limited context, the Court had to further decide that the "predominant theme" of the speech was of public concern, since some of the signs could also reasonably be interpreted as referring to the plaintiff or his family. The result was a conclusion that the speech in Snyder wasn't really about the plaintiff at all, which I believe is how the Chief Justice could conclude that it was in the category of speech afforded the most protection by the Supreme Court. I believe this is an important distinction between Rosenbloom and Snyder; if that's true, then we may not yet know if this court might adopt Justice Brennan's reasoning in a case applied to speech either about or targeted at a private individual.

Friday, March 11, 2011

American Academy of Actuaries on Social Security

Who would be in a better position than the American Academy of Actuaries to evaluate a benefit plan like Social Security? I suggest reading this report on Social Security from the Academy, which explains why a safety net program like this needs to be a defined benefit plan instead of a defined contribution plan. From the abstract:

As originally conceived, Social Security provided monthly benefits for life to covered workers who ceased employment after attaining age 65. Benefits were calculated by a formula based on each worker’s employment history and were payable for life, regardless of how long the worker lived or the amount of taxes paid on his or her behalf while working. Thus, there was at best an indirect relationship between taxes paid and benefits received.

Plans such as this, where the benefits are determined according to a formula and generally paid for life, are called defined benefit plans. By contrast, plans that pay benefits based on amounts accumulated in an individual’s account are called defined contribution plans (or individual account plans).

Much has changed since Social Security was created. The program has expanded to cover new classes of beneficiaries, such as spouses of retired workers, surviving spouses and other family members of deceased workers, and disabled workers and their families. Many U.S. workers have also earned benefits under employer-sponsored defined benefit plans. These developments account, in part, for the fact that the elderly now have the lowest poverty rate among all age classes.

However, over the past 25 years, many employers have dropped sponsorship of their defined benefit plans in favor of defined contribution plans. Many Americans are now saving for their own retirements through employer-sponsored 401(k) plans (a type of defined contribution plan), individual retirement accounts, and personal savings. Some people believe that Social Security would also work better if converted, in whole or in part, to a defined contribution structure.

After careful study of the issues involved, the Social Insurance Committee of the American Academy of Actuaries has concluded that the defined benefit structure is preferable to the defined contribution structure for providing basic retirement benefits under Social Security. Because of its ability to tailor benefits that meet the needs of beneficiaries in different circumstances and its inherent risk-sharing attributes, the defined benefit structure is more efficient at providing the floor of retirement and disability protection needed by U.S. workers, particularly those least able to supplement their Social Security benefits from other income sources. This conclusion is only strengthened by the trend toward defined contribution structures among employer-sponsored retirement plans, since this leaves Social Security as the only remaining defined benefit plan for many workers. This is not to suggest that a defined contribution approach should not be a part of Social Security reform, but this committee would support it only as a supplement to the benefits provided under a basic defined benefit program.