Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: We've been spelling it wrong for over a quarter century 8

I'm surprised that this hasn't been addressed by the academic communities. Someone with a degree in English or linguistics or something like that should have though of this decades ago.

This word (actually more than one word) has various spellings, and I've probably used all of them at one time or another. The word is email, or eMail, or e-mail, or some other variation. They're all wrong.

It's a contraction of "electronic mail" and as such should be spelled e'mail. The same with e'books and other e'words.

So why hasn't someone with a PhD in English pointed this out to me? I have no formal collegiate training in this field. It's a mystery to me.

User Journal

Journal Journal: Are printed books' days numbered? 4

In his 1951 short story The Fun They Had, Isaac Asimov has a boy who finds something really weird in the attic -- a printed book. In this future, all reading was done on screens.

When e'books* like the Nook and Kindle came out, there were always women sitting outside the building on break on a nice spring day reading their Nooks and Kindles. It looked like the future to me, Asimov's story come true. I prefer printed books, but thought that it was because I'm old, and was thirty before I read anything but TV and movie credits on a screen.

And then I started writing books. My youngest daughter Patty is going to school at Cincinnati University (as a proud dad I have to add that she's Phi Beta Kappa and working full time! I'm not just proud, I'm in awe of her) and when she came home on break and I handed her a hardbound copy of Nobots she said "My dad wrote a book! And it's a REAL book!"

So somehow, even young people like Patty value printed books over e'books.

My audience is mostly nerds, since few non-nerds know of me or my writing, so I figured that the free e'book would far surpass sales of the printed books. Instead, few people are downloading the e'books. More download the PDFs, and more people buy the printed books than PDFs and ebooks combined.

Most people just read the HTML online, maybe that's a testament to my m4d sk1llz at HTML (yeah, right).

Five years ago I was convinced ink was on the way out, but there's a book that was printed long before the first computer was turned on that says "the news of my death has been greatly exaggerated".

* I'll write a short story about the weird spelling shortly.

User Journal

Journal Journal: Where's my damned tablet? 11

I'd like to know why in the hell nobody is selling a tablet, or maybe an app for existing tablets, that will let me watch over the air TV on it?

All the necessary hardware is there. Wi-fi and bluetooth are radios. Some cell pones can pick up FM music stations, and have been able to do so and have done so for years.

The FM radio band sits between channels six and seven on the VHF television channels. If it can hear radio, it can see TV.

The technology is there, why isn't the commercial device to be found? Offer a tablet I can watch TV without the internet and I'll buy one. Maybe two.

User Journal

Journal Journal: Systemd (or, how to make portable software) 10

In this post, Lennart explains that he doesn't know how to write portable C code. He says:

[Making systemd portable] would turn every second line of systemd into #ifdefs.

The purpose of my post here is to explain how to write portable code, without #ifdefs on every other line. If that happens, you are doing it the hard way.

An easier way is to create an OS independent layer. Call it OSI (since no one is using that acronym anymore, right?). Create a header file that declares all your functions, then create an implementation file for each platform. Every time you find a piece of functionality that is different on different platforms, throw it into that header file.

For example, if you need to take a screenshot, it will be different on every platform you find. In the header file, create a function OSI_Screenshot(). Then in your OSI_Windows.c file, add an implementation for windows. In your OSI_Linux.c, add a screenshot implementation for Linux. In your OSI_OSX.c, add your implementation for OSX. This technique can also work for extremely incompatible platforms, with OSI_printf(), or OSI_malloc(), etc. If you use your compiler correctly, you can compile it without any extra overhead from the function call.

An example of this technique can be found in Android (look at sysdeps.h and sysdeps_win32.c), demonstrating that this technique works. They don't have #ifdefs scattered throughout their code. The Android example is tougher than it needs to be, because Android added the compatibility layer after the code was written. If they had started at the beginning, the code would have been much simpler.

The lack of knowledge (about how to write portable code) in the systemd team is causing them to make bad decisions, because the alternative seems too hard. For example:

I have no plans porting it to other kernels, and I will not merge any such patches........Quite frankly, I'd like to question [cross-platform compatibility]. In the light of GNOME OS I think we need to ask ourselves the question if we do ourselves any good if we continue to support all kinds of kernels that simply cannot keep up with Linux anymore.

Those who don't understand the failures of the past are destined to repeat them. Plenty of vendors try to focus on a single platform, and their work disappeared, to be replaced by something that was cross-platform compatible, and usually better work. The discipline required to keep things portable results in better code (there's a quote from Mythical Man Month that fits here but I'm too lazy to look it up). The Gnome developers understand the importance of portability but that's a story for another post.

User Journal

Journal Journal: Triplanetary 1

I've uploaded a new book to mcgrewbooks.com. Edgar E. Smith was a well known science fiction writer known as "the father of space opera", and Doctor Smith was a food engineer in his other life. The novel I've uploaded is Triplanetary, first published in serial form in Amazing Stories in 1934.

Some of the dialogue is a bit juvenile, but it would make a great movie.

User Journal

Journal Journal: An Accidental Book 1

I've read books accidentally, meaning to read a single chapter and winding up reading it in one setting, but I've never started writing one accidentally.

Until now.

Tired of editing Random Scribblings and Voyage to Earth and Other Stories (Formerly titled "Mars Bars"), I thought I'd look for another science fiction novel in the public domain a little less ancient than The Time Machine to add to my web site.

I didn't find one, so decided to just make a book of public domain short stories by the 20th century greats. I found a LOT, and started assembling a book. Somehow, I wound up adding commentary and thought "Hey! New book!"

Then I discovered that one of the short stories wasn't so short -- in fact, it was a full blown novel. So for the last several days I've been formatting it to put on my web site. E.E. "Doc" Smith's Triplanetary will be posted in a few days.

I'll let you know when it's there. I guess I'm working on three books again. The collection I'm working on is tentatively titled "Yesterday's Tomorrow".

User Journal

Journal Journal: Systemd's solution to large init scripts 1

(Note: When you write code, you're making a UI for programmers. Learn to do it well.)

Below you can see a traditional unix init script. It's long, but if you're familiar with shell-script you can figure out what is going on. There is a lot of redundancy here, most init scripts have a switch that runs an option based on the first command-line parameter, for example. One solution is to put common code in a function, but Poettering decided to use config files.

Let's examine the general tradeoff between putting code in a function, and using config files (a form of declarative programming). Config files are fine as long as there aren't too many special cases. If there are too many special cases, you end up with so many options and keywords that it would have been easier to just use a scripting language.

The good side is systemd saves a lot of typing. Way down at the bottom, is a unit file for the same init script. It's clearly shorter, and easier to type.

The bad side is it has arcane keywords which are are not discoverable merely by looking at the file. This is a pattern that repeats itself over and over in systemd, things are easier if you know how to do them, but the system itself is inscrutable without arcane knowledge.

Ideal systems fulfill the requirements while making it easy for those who want to dig deeper. The system opens like the petals of a rose.

#!/bin/bash
# Starts the abrt daemon
#
# chkconfig: 35 82 16
# description: Daemon to detect crashing apps
# processname: abrtd
### BEGIN INIT INFO
# Provides: abrt
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: start and stop abrt daemon
# Description: Listen to and dispatch crash events
### END INIT INFO
 
# Source function library.
. /etc/rc.d/init.d/functions
ABRT_BIN="/usr/sbin/abrtd"
LOCK="/var/lock/subsys/abrtd"
OLD_LOCK="/var/lock/subsys/abrt"
RETVAL=0
 
#
# Set these variables if you are behind proxy
#
#export http_proxy=
#export https_proxy=
 
#
# See how we were called.
#
 
check() {
    # Check that we're a privileged user
    [ "`id -u`" = 0 ] || exit 4
 
    # Check if abrt is executable
    test -x $ABRT_BIN || exit 5
}
 
start() {
 
    check
 
    # Check if it is already running
    if [ ! -f $LOCK ] && [ ! -f $OLD_LOCK ]; then
        echo -n $"Starting abrt daemon: "
        daemon $ABRT_BIN
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch $LOCK
        echo
    fi
    return $RETVAL
}
 
stop() {
 
    check
 
    echo -n $"Stopping abrt daemon: "
    killproc $ABRT_BIN
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f $LOCK
    [ $RETVAL -eq 0 ] && rm -f $OLD_LOCK
    echo
    return $RETVAL
}
 
restart() {
    stop
    start
}
 
reload() {
    restart
}
 
case "$1" in
start)
    start
;;
stop)
    stop
;;
reload)
    reload
;;
force-reload)
    echo "$0: Unimplemented feature."
    RETVAL=3
;;
restart)
    restart
;;
condrestart)
    if [ -f $LOCK ]; then
        restart
    fi
    # update from older version
    if [ -f $OLD_LOCK ]; then
        restart
    fi
;;
status)
    status abrtd
    RETVAL=$?
;;
*)
    echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
    RETVAL=2
esac
 
exit $RETVAL

-----------------------------------------------------------------------------------------

[Unit]
Description=Daemon to detect crashing apps
After=syslog.target
 
[Service]
ExecStart=/usr/sbin/abrtd
Type=forking
 
[Install]
WantedBy=multi-user.target

Reference to the examples.

User Journal

Journal Journal: systemd - Why did Debian Adopt it? 8

There's a Debian debate page, but it's disappointing and everything systemd does is listed with equal value. Thanks to Russ Albery for making a much more balanced assessment, explaining what he likes. The short answer to the question is: SystemD makes things much easier for people writing init scripts. It wasn't about cgroups, or speed, or login managers, it was about writing easy init scripts.

Here are the major complaints he has with the traditional startup system:

* Lack of integration with kernel-level events to properly order startup.
* No mechanism for process monitoring and restarting beyond inittab.
* Heavy reliance on shell scripting rather than declarative syntax.
* A fork and exit with PID file model for daemon startup.

He furthermore points out these problems with startup scripts:

The model of fork and exit without clear synchronization points is inherently racy, the boot model encoded into sysvinit doesn't reflect a modern system boot, and maintaining large and complex init scripts as conffiles has been painful for years. Nearly every init script, including the ones in my own packages, have various edge-case bugs or problems because it's very hard to write robust service startup in shell, even with the excellent helper programs and shell libraries that Debian has available.

Those are the main things that systemd fixes for a distro builder, and probably why so many distros have switched to systemd, because it was built for them.

User Journal

Journal Journal: Is Microsoft Sirius? 1

I had to laugh when I ran across this article.

"Cortana's UI now expresses 18 different emotions. Siri remains detached and aloof."

Yes, Microsoft is apparently the Sirius Cybernetics Corporation with its " Genuine People Personalities". So when are they going to make that "Marvin" interface?

User Journal

Journal Journal: Amnesia 4

If slashdot still hasn't fixed the "fine in preview, fucked in submit" bug, there's a readable version here.

Amnesia
        He awoke wondering where he was... on a medic. Why was... oh, hell, why was he being held down? And then the big question hit him â" Who am I?
        And who, besides the medic itself, which was only a robot, had imprisoned him? And why?
        There was a tube leading into his arm... was he in a hospital? It smelled like a hospital.
        The medic beeped, and said âoecondition improved, now stable.â
        He must have had some kind of accident, but he couldnâ(TM)t remember his own name, let alone how he wound up in a hospital.
        âoeComputer!â he said, hoping the hospital computer could shed some light. It was apparently not paying attention, because it ignored him. He lay there strapped to the robotic table for what seemed like forever when the medic again beeped and spoke. âoeCondition improved, now fair.â
        âoeComputer!â
        No answer.
        Damn. âoeMedic!â
        No answer.
        Another eternity passed, and the medic reported âoeCondition good, patient released.â The straps came loose and he sat up on the medic, waiting for a nurse or doctor that never showed up. Didnâ(TM)t someone have paperwork when a patient was released?
        He decided to look around the hospital to find someone and tell them that he shouldnâ(TM)t have been released, that he had no memory. He used the rest room and went searching for help.
        This, he thought, was the strangest thing... this hospital seemed to have no doctors, no nurses, no administrative staff, nobody. Not even any patients. He walked down hall after hall, and found nothing but locked doors and more hallways.
        He started to panic, and muscle memory reached his hand into his pocket for a phone. There was none there.
        That panicked him. Why didnâ(TM)t he think of it before? It could have told him at least who he was, if not where he was and why.
        He started running, down first one hallway then another, until he collapsed in exhaustion and anguish. He sat there in the hallway, head in his hands, sobbing softly.
        Quite a while later he finally came to his senses, sort of. He got up and decided to just walk around, looking for... anything, really, but especially people. Where was everyone? It would be nice if he could find a sandwich, too; he was starting to get a little hungry. That added to his already numerous worries.
        He found no exits, no unlocked doors, no people, no sandwiches. It was hard enough to keep his fear below panic levels, but then what was obviously some sort of alarm went off. Was the building on fire? He stopped, with no idea what to do.
        He looked up â" werenâ(TM)t there skylights showing stars earlier? But his memory was impaired, after all, not able to remember his name or anything before waking up on the medic.
        He heard the first sounds that didnâ(TM)t come from robots that heâ(TM)d heard since awakening, and it scared him even more â" the sound of hail. Perhaps there were skylights, but were now shuttered.
        At this point he was aware that the alarm was almost certainly a tornado warning, and he couldnâ(TM)t find the stairway! Maybe this building didnâ(TM)t even have a basement, but who in their right mind would build a structure in a tornado zone without one? But without a stairwell, it might as well not have a basement. He huddled in a doorway waiting for the tornado to destroy him and the building.
        The sounds of hail stopped, the siren stopped, and yes, there were skylights; the shutters opened then, showing stars once again. Odd that the storm had started and ended so fast. The shutters must have closed before the clouds rolled in.
        He started to continue his fruitless search.
        A robot wheeled past, and he had an idea. The robot would certainly lead him to something.
        It did. Down a hallway heâ(TM)d not yet explored and probably had run past more than once in his earlier panic was a large door that stood wide open, the automatic pocket doors recessed. Inside was a huge room filled with tables and chairs, but still no sign of humanity at all. The robot heâ(TM)d followed dragged another robot away. Puzzling.
        At least he had somewhere to sit besides the floor. He sat down at one of the many tables to rest, thinking heâ(TM)d have to figure out how to find his way back before continuing his search.
        He just couldnâ(TM)t stop wondering what the hell was going on. Was he being studied in some sort of weird experiment? Was he a prisoner by design, or by accident? Was he a criminal? Did he have a family?
        Without even thinking he started praying out loud, âoeOh, Lord, please help me...â
        A mechanical voice chimed in. âoeCan I help you, sir?â
        He looked up at the robot. âoeYes,â he said, âoehow can I get out of this building?â
        âoeIâ(TM)m sorry, sir, but that is not in my database. Can I get you something to drink?â
        âoeYes, cold water, but first, where am I?â
        âoeThis is the commons area, sir. Would you like a menu?â Without waiting for an answer, the video screen displayed a menu.
        âoeYes, Iâ(TM)ll have a cheeseburger, brogs, and a caffeine shike.â
        âoeYes, sir,â it said, and started to roll away.
        âoeWait!â the man said. âoeWhat is this the commons of?â
        âoeThat information is not in my database.â
        âoeCan you tell me what this building is?â
        âoeIâ(TM)m sorry, sir, but that information is not in my database. Is there anything else, sir, or should I fetch your order?â
        âoeNo, go on.â It rolled off. He put his elbow on the table and rested his head in his hand.
        The robot came back shortly with his water and shike and rolled away again.
        âoeWhat the hell is going on?â he wondered aloud, again.
        The robot came back in with his food and wheeled away. He ate, still not able to figure out how to examine his prison and still find his way back to this âoecommonsâ. At least he had food and drink now, which relieved him greatly and made exploration of this building far less, yet still, important.
        Then he thought: A commons. A common area. People should show up here, perhaps he should just wait for someone to show up?
        Several hours later and the skylight still showed stars. Was he in Antarctica? Or was he... Yes, that explained everything. He was on a space ship, but why? Where was it going? Where was the captain?
        Was he the captain? Or... a horrifying thought came to him. Was he a pirate who had killed the captain and thrown the body out the airlock?
        His thoughts were interrupted by the sounds of humanity â" boots walking down the hallway, and cautious whispering voices.
        He looked around the doorway and saw ten heavily armed, armored, and helmeted men.
        âoeOh shit,â he thought. He was captain, but didnâ(TM)t even recognize his own boat, let alone how to run it, and now there were pirates who would surely murder him and steal the ship and whatever cargo it was carrying. He cowered in a corner, wishing for something to defend himself with.
        They came in, weapons drawn, with the men in the back facing the other way and backing in. The man in front lowered his weapon and raised his face shield. âoeJerry? Christ, man, what the hell is going on?â
        âoeMy name is Jerry? Are you sure? I donâ(TM)t know who I am!â
        âoeJesus, Jerry, Iâ(TM)ve known you for years, youâ(TM)re Jerry Smith. I was scared shitless for you, what the hell happened? Did you get attacked by pirates?â
        âoeI... I donâ(TM)t think so. Iâ(TM)d be dead if they had. The first thing I remember is waking up on a medic wondering who I was and where I was and why I was on a medic. I wandered around for hours, I donâ(TM)t think anybody else is here.â
        âoeOkay, Joe, check the pilot room. Rob, would you do an engine inspection?â
        âoeSure thing, boss.â
        âoeJerry, where are your phone and tablet?â
        He shook his head. âoeNo idea, but I was sure wishing I had them.â
        They took Jerry to Earth with them while another man piloted Jerryâ(TM)s ship there.
        He did eventually get his memory back after a lot of therapy. His phone had been in his captainâ(TM)s quarters, and he had been doing inspection in machine storage when a can of something that had been improperly stacked by a malfunctioning robot had fallen, hitting him in the head and knocking him cold. A medic had taken him to sick bay, leaving the tablet laying on the floor, effectively locking him out of everything. Clearly, some policies, at least, would have to be changed.
        Jerry never captained another ship. In fact, he spent the rest of his life on Earth and never entered space again.

User Journal

Journal Journal: systemd - A descendent of Apple's LaunchD 1

Systemd is a descendent of Apple's launchd, Lennart suggested the world watch this movie to learn about it, so why? What is good about launchd?

OSX has an excellent inter-processing message system, part of the mach kernel (which they got from CMU). Because of this, many times processes talk to each other through the standard messaging queues. If you use a library to launch a browser window, or query wifi strength, it will communicate through a message queue (although the library takes care of the details).

The interesting thing is that launchd can open a message queue before the recipient is running. So launchd doesn't launch services until they are needed, and if they aren't needed, they never get launched. The benefit is that resources are preserved, things don't get launched until someone sends a message.

The benefit here is dependency resolution. Instead of forcing a deep calculation of what depends on what, or forcing the server script to declare everything it depends on, you can say "manage all these thousand services!" and only the few that are needed will be used, when they are needed.

Another thing I think Lennart copied from launchd is the declarative config files. You don't need to write a shell script, you merely need to indicate what should be launched, and maybe give it configuration options like "relaunch on failure" or "launch completely before receiving message." Of course, some people like config files, others prefer scripts.....that's not an argument I want to get into here, I'm merely pointing out things that seem to have come from launchd. (

What is bad:

Launchd is utterly undiscoverable. It would have been nice of them to put a README in /etc/rc/ or something saying, "hey, all your startup scripts are gone, look elsewhere."

Launchd has a complex hierarchy of directories that it searches for startup scripts. They have justifications for why, and a reason behind each one.......but justifications and reasons are not the same as good design. Every bad design decision ever made had a justification and a reason.

User Journal

Journal Journal: Systemd - Efficiency and Pike's Rules of Programming 4

(DISCLAIMER: These are my notes and might be wrong.)

Lennart Poettering has never heard of Rob Pike's rules of programming. Let's examine why:

He said, "On my system the scripts in /etc/init.d call grep at least 77 times.... that has to be incredibly slow...., and should be rewritten in C."

You can time it yourself, with this command:

time for i in {1..77}; do grep user /etc/passwd > /dev/null; done

On my machine it takes 0.229 seconds.

Lennart didn't get the speed increase he wanted. From his benchmark report, "booting up with Upstart takes 27s, with systemd we reach 24s." This result isn't too bad: when I've made a similar mistake of writing code before timing anything, ignoring Pike's rules for programming, once I actually slowed the system down.

If you don't measure, you can't optimize.

For entertainment and enlightenment, here is a quote by Ken Thompson talking vaguely about Pike's rules for programming:

Early Unix programmers became good at modularity because they had to be. An OS is one of the most complicated pieces of code around. If it is not well structured, it will fall apart. There were a couple of early failures at building Unix that were scrapped. One can blame the early (structureless) C for this, but basically it was because the OS was too complicated to write. We needed both refinements in tools (like C structures) and good practice in using them (like Rob Pike's rules for programming) before we could tame that complexity.

User Journal

Journal Journal: SystemD: The Beginning 7

DISCLAIMER: THIS CODE REVIEW IS A LONG WORK IN PROGRESS, I COULD BE COMPLETELY WRONG IN ANYTHING I SAY.

To do a proper code review, you need to understand the purpose of the code, what all the stakeholders want. From my own perspective, init scripts work fine, but since Unix companies keep trying to create new init systems, they must have different needs than I do.

Here's a list of the stakeholders. I need to figure out what their goals are.
1) System admins.
2) Desktop users.
3) Distro builders.
5) Android (if systemd turns out to be good enough).
4) Programmers

My suspicion is that systemd has taken over because it makes things easier for 3.

At its core, Unix is a system for programmers. What other system comes with a compiler and multiple interpreters by default? Bash is so much more useable than DOS, or even powershell (yeah, go ahead and flame me but I'm right, Powershell doesn't even have < working). Unix was designed by programmers and for programmers.

The reason I'm talking about it is the traditional init process is incredibly discoverable. All you have to do is look in the /etc/rc directories, and you can figure out how your system boots. You can see it all. For a programmer it's easy. Poking around in the system to understand it is one thing that makes Unix great (and what I like about Slackware: the whole thing is lovingly crafted).

So that describes the approach I am taking to code review, and to the init process. Hopefully Systemd is an improvement.

User Journal

Journal Journal: After Several Months Not Bothering 5

I visit a few threads here, on reasonable topics - like Barrett Brown case, etc.

The level of discourse has really troughed. It's like "conversation" between the Dufflepuds..

It's not worth even trolling these people. There isn't enough signal-to-noise for this to even register.

Slashdot Top Deals

All seems condemned in the long run to approximate a state akin to Gaussian noise. -- James Martin

Working...